Hi,

When a hot standby is restarted in a state where subtransactions have overflowed, it may become inaccessible:

$ psql: error: connection to server at "localhost" (::1), port 5433 failed: FATAL: the database system is not yet accepting connections
          DETAIL:  Consistent recovery state has not been yet reached.

However, the log message that indicates the cause of this issue seems to be only output at the DEBUG1 level:

  elog(DEBUG1,
       "recovery snapshot waiting for non-overflowed snapshot or "
       "until oldest active xid on standby is at least %u (now %u)",
       standbySnapshotPendingXmin,
       running->oldestRunningXid);

I believe this message would be useful not only for developers but also for users.
How about changing the log level from DEBUG1 to NOTICE or else?


Background:
One of our customers recently encountered an issue where the hot standby became inaccessible after a restart. The issue resolved itself after some time and I suspect it was caused by a subtransaction overflow. If the log level had been higher one, it would have been easier to diagnose the problem. ..Even if it was a NOTICE, it may be difficult to notice the cause if the log_min_message is set to default WARNING, but well, it seems a higher log level is better than DEBUG1.

I would appreciate your thoughts.


--
Regards,

--
Atsushi Torikoshi
Seconded from NTT DATA GROUP CORPORATION to SRA OSS K.K.
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 2e54c11f88..20c505add7 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -1125,7 +1125,7 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
 					 "recovery snapshots are now enabled");
 			}
 			else
-				elog(DEBUG1,
+				elog(NOTICE,
 					 "recovery snapshot waiting for non-overflowed snapshot or "
 					 "until oldest active xid on standby is at least %u (now %u)",
 					 standbySnapshotPendingXmin,
@@ -1303,7 +1303,7 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
 	if (standbyState == STANDBY_SNAPSHOT_READY)
 		elog(DEBUG1, "recovery snapshots are now enabled");
 	else
-		elog(DEBUG1,
+		elog(NOTICE,
 			 "recovery snapshot waiting for non-overflowed snapshot or "
 			 "until oldest active xid on standby is at least %u (now %u)",
 			 standbySnapshotPendingXmin,

Reply via email to