Improve error message when standby does accept connections. Even after reaching the minimum recovery point, if there are long-lived write transactions with 64 subtransactions on the primary, the recovery snapshot may not yet be ready for hot standby, delaying read-only connections on the standby. Previously, when read-only connections were not accepted due to this condition, the following error message was logged:
FATAL: the database system is not yet accepting connections DETAIL: Consistent recovery state has not been yet reached. This DETAIL message was misleading because the following message was already logged in this case: LOG: consistent recovery state reached This contradiction, i.e., indicating that the recovery state was consistent while also stating it wasn’t, caused confusion. This commit improves the error message to better reflect the actual state: FATAL: the database system is not yet accepting connections DETAIL: Recovery snapshot is not yet ready for hot standby. HINT: To enable hot standby, close write transactions with more than 64 subtransactions on the primary server. To implement this, the commit introduces a new postmaster signal, PMSIGNAL_RECOVERY_CONSISTENT. When the startup process reaches a consistent recovery state, it sends this signal to the postmaster, allowing it to correctly recognize that state. Since this is not a clear bug, the change is applied only to the master branch and is not back-patched. Author: Atsushi Torikoshi <torikos...@oss.nttdata.com> Co-authored-by: Fujii Masao <masao.fu...@gmail.com> Reviewed-by: Yugo Nagata <nag...@sraoss.co.jp> Discussion: https://postgr.es/m/02db8cd8e1f527a8b999b94a4bee3...@oss.nttdata.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/b53b88109f94bd81ed0ac580035a936000bc2865 Modified Files -------------- doc/src/sgml/high-availability.sgml | 12 ++++++++---- src/backend/access/transam/xlogrecovery.c | 6 ++++++ src/backend/postmaster/postmaster.c | 12 +++++++++--- src/backend/tcop/backend_startup.c | 18 +++++++++++++----- src/include/storage/pmsignal.h | 1 + src/include/tcop/backend_startup.h | 2 +- 6 files changed, 38 insertions(+), 13 deletions(-)