]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Reduce log level of some logical decoding messages from LOG to DEBUG1
authorFujii Masao <fujii@postgresql.org>
Wed, 1 Apr 2026 06:43:02 +0000 (15:43 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 1 Apr 2026 06:43:02 +0000 (15:43 +0900)
Previously some logical decoding messages (e.g., "logical decoding found
consistent point") were logged at level LOG, even though they provided
low-level, developer-oriented information that DBAs were typically not
interested in.

Since these messages can occur routinely (for example, when keeping calling
pg_logical_slot_get_changes() to obtain the changes from logical decoding),
logging them at LOG can be overly verbose.

This commit reduces their log level to DEBUG1 to avoid unnecessary log noise.

This change applies to a small set of messages for now. Additional messages
may be adjusted similarly in the future.

Even with this change, if these messages from walsender still need to be
observed, enabling DEBUG1 logging selectively for walsender (e.g.,
log_min_messages = 'warning,walsender:debug1') would be helpful to avoid
increasing overall log volume.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwGTyHgtD9tyN664x6vQ8Q1G53H7ZUCgBU9_X=nLt3f1QA@mail.gmail.com

src/backend/replication/logical/logical.c
src/backend/replication/logical/snapbuild.c
src/test/recovery/t/038_save_logical_slots_shutdown.pl

index 603a2b94d054d8eb9b1a0b1549380c155fd6157b..f20d0c542f3af01e8cd153b2dd123f7be5373841 100644 (file)
@@ -598,7 +598,7 @@ CreateDecodingContext(XLogRecPtr start_lsn,
 
        ctx->reorder->output_rewrites = ctx->options.receive_rewrites;
 
-       ereport(LOG,
+       ereport(DEBUG1,
                        (errmsg("starting logical decoding for slot \"%s\"",
                                        NameStr(slot->data.name)),
                         errdetail("Streaming transactions committing after %X/%08X, reading WAL from %X/%08X.",
index 37f0c6028bd2efd5a79c4528c5bd2824ece5e659..b4269a3b1025082e4ee30201567cac7c253a96d6 100644 (file)
@@ -1312,7 +1312,7 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn
                builder->state = SNAPBUILD_CONSISTENT;
                builder->next_phase_at = InvalidTransactionId;
 
-               ereport(LOG,
+               ereport(DEBUG1,
                                errmsg("logical decoding found consistent point at %X/%08X",
                                           LSN_FORMAT_ARGS(lsn)),
                                errdetail("There are no running transactions."));
@@ -1409,7 +1409,7 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn
                builder->state = SNAPBUILD_CONSISTENT;
                builder->next_phase_at = InvalidTransactionId;
 
-               ereport(LOG,
+               ereport(DEBUG1,
                                errmsg("logical decoding found consistent point at %X/%08X",
                                           LSN_FORMAT_ARGS(lsn)),
                                errdetail("There are no old transactions anymore."));
@@ -1915,7 +1915,7 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
 
        Assert(builder->state == SNAPBUILD_CONSISTENT);
 
-       ereport(LOG,
+       ereport(DEBUG1,
                        errmsg("logical decoding found consistent point at %X/%08X",
                                   LSN_FORMAT_ARGS(lsn)),
                        errdetail("Logical decoding will begin using saved snapshot."));
index c0392d50460b2804f8318892f2cef7d394536c27..05aa78b4bc7e8f03fb0b9cd29a22b68b9c12682b 100644 (file)
@@ -48,6 +48,7 @@ $node_publisher->append_conf(
        'postgresql.conf', q{
 checkpoint_timeout = 1h
 autovacuum = off
+log_min_messages = 'debug1'
 });
 $node_publisher->start;