Skip to content

Commit

Permalink
Print debug from shards, too
Browse files Browse the repository at this point in the history
  • Loading branch information
EinKrebs committed Apr 16, 2024
1 parent 7e018bd commit f9ac753
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/shard/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ host all all all trust
EOF

cat >> /var/lib/postgresql/$POSTGRES_VERSION/main/postgresql.conf <<-EOF
logging_collector = on
log_min_messages = info
log_statement = 'all'
log_directory = '/var/log/postgresql/'
log_filename = 'postgresql-13-main.log'
listen_addresses = '*'
port = 6432
max_prepared_transactions = 5
Expand Down
14 changes: 14 additions & 0 deletions test/feature/spqr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ func (tctx *testContext) saveLogs(scenario string) error {
var logsToSave map[string]string
switch {
case strings.HasPrefix(service, spqrShardName):
for file := range postgresqlLogsToSave {
remoteFile, err := tctx.composer.GetFile(service, file)
if err != nil {
errs = append(errs, err)
continue
}
content, err := io.ReadAll(remoteFile)
if err != nil {
errs = append(errs, err)
continue
}
fmt.Printf("\"%s\" shard logs:\n", service)
fmt.Println(string(content))
}
logsToSave = postgresqlLogsToSave
case strings.HasPrefix(service, spqrRouterName):
for file := range routerLogsToSave {
Expand Down

0 comments on commit f9ac753

Please sign in to comment.