| From: | Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com> |
|---|---|
| To: | Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | [PATCH] Fix recovery connection detail in EXEC_BACKEND builds |
| Date: | 2026-10-12 07:14:24 |
| Message-ID: | CAMm1aWYtiKDv7uzPWJZ2Gre2973bRV=GTOhd6BU_-VxdeSkGVg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
The recent discussion about reachedConsistency in [1] mentioned a
separate EXEC_BACKEND issue. When a connection is rejected after
recovery has reached consistency but before a hot standby snapshot is
ready, backend startup uses reachedConsistency to select the error
detail. On Unix systems using fork(), the backend inherits
reachedConsistency from the postmaster. In EXEC_BACKEND builds, this
process-local variable is not inherited by the backend. Consequently,
it reports:
DETAIL: Consistent recovery state has not been yet reached.
instead of:
DETAIL: Recovery snapshot is not yet ready for hot standby.
It also omits the associated hint about transactions with more than 64
subtransactions.
The attached patch passes reachedConsistency through
BackendStartupData, alongside canAcceptConnections, and uses the
captured value when choosing the connection error detail. This only
changes the reported DETAIL and HINT; connection acceptance and
recovery behavior are unaffected.
I tested this on Linux with both normal and EXEC_BACKEND builds. The
core regression tests passed under EXEC_BACKEND, and manual testing
confirmed the expected DETAIL and HINT. I have not tested it on
Windows.
Please review and share your feedback.
Best Regards,
Nitin Jadhav
Microsoft
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-fix-recovery-connection-detail-in-exec-backend-builds.patch | application/octet-stream | 3.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | 민영재 | 2026-10-12 07:15:22 | Re: BUG #19736: `JSON_OBJECT ... ABSENT ON NULL` accepts invalid keys when the value is NULL |
| Previous Message | Ayush Tiwari | 2026-10-12 07:04:33 | Re: PANIC serves too many masters |