From 6129077d31266361a79bf91cc9f95572e8fd39b5 Mon Sep 17 00:00:00 2001 From: MMeent Date: Thu, 26 Oct 2023 13:21:41 +0200 Subject: [PATCH] WALRedo: Limit logging to log_level = ERROR and above (#5587) This fixes issues in pageserver's walredo process where WALRedo logs of loglevel=LOG are interpreted as errors. ## Problem See #5560 ## Summary of changes Set the log level to something that doesn't include LOG. --- pgxn/neon_walredo/walredoproc.c | 10 ++++++++++ test_runner/fixtures/neon_fixtures.py | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pgxn/neon_walredo/walredoproc.c b/pgxn/neon_walredo/walredoproc.c index 01e12983a6..e0c6c6e30a 100644 --- a/pgxn/neon_walredo/walredoproc.c +++ b/pgxn/neon_walredo/walredoproc.c @@ -201,6 +201,16 @@ WalRedoMain(int argc, char *argv[]) #endif am_wal_redo_postgres = true; + /* + * Pageserver treats any output to stderr as an ERROR, so we must + * set the log level as early as possible to only log FATAL and + * above during WAL redo (note that loglevel ERROR also logs LOG, + * which is super strange but that's not something we can solve + * for here. ¯\_(-_-)_/¯ + */ + SetConfigOption("log_min_messages", "FATAL", PGC_SUSET, PGC_S_OVERRIDE); + SetConfigOption("client_min_messages", "ERROR", PGC_SUSET, + PGC_S_OVERRIDE); /* * WAL redo does not need a large number of buffers. And speed of diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 0c0c06aa86..0e9f823860 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1631,7 +1631,6 @@ class NeonPageserver(PgProtocol): ".*took more than expected to complete.*", # these can happen during shutdown, but it should not be a reason to fail a test ".*completed, took longer than expected.*", - '.*registered custom resource manager \\\\"neon\\\\".*', # AWS S3 may emit 500 errors for keys in a DeleteObjects response: we retry these # and it is not a failure of our code when it happens. ".*DeleteObjects.*We encountered an internal error. Please try again.*",