pgsql: Reduce log verbosity during prepared transaction recovery

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Reduce log verbosity during prepared transaction recovery
Date: 2026-10-29 14:10:16
Message-ID: E1xMQpc-00000001Gac-214V@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Reduce log verbosity during prepared transaction recovery

Previously, RecoverPreparedTransactions() logged each prepared
transaction at LOG level at the end of recovery. With many unresolved
prepared transactions, these messages could clutter the server log.

Lower the severity of these messages to DEBUG2, matching the messages
in PrepareRedoAdd() and PrepareRedoRemoveFull(), and report the
number of successfully recovered prepared transactions in a single
LOG message. This reduces log clutter while retaining per-transaction
details at DEBUG2.

Author: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Reviewed-by: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Reviewed-by: Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAE9k0Pmq1qQEvTKqsBTwUAWrNw+191zcTBPVKmmP5E3X2C+_Xw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c11eb5de01ba3401e880195888fb25703e0edf10

Modified Files
--------------
src/backend/access/transam/twophase.c | 16 ++++++++++++----
src/test/recovery/t/009_twophase.pl | 15 +++++++++++++--
2 files changed, 25 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2026-10-29 15:03:30 pgsql: pg_plan_advice: Suppress advice from unflattened set operations.
Previous Message Fujii Masao 2026-10-29 11:46:36 pgsql: Use pg_parse_lsn() to parse LSN fields in backup_label