From: | Hao Wu <hawu(at)vmware(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Cc: | Paul Guo <guopa(at)vmware(dot)com> |
Subject: | HotStandbyActive() issue in postgres |
Date: | 2021-03-12 02:14:42 |
Message-ID: | CY4PR0501MB3906D8C93CBDD321284D7E95A46F9@CY4PR0501MB3906.namprd05.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi hackers,
When we enable hot standby, HotStandbyActive() returns true on hot standby.
Then, we promote the hot standby, the SHM variable `XLogCtl->SharedHotStandbyActive`
remains true. So, HotStandbyActive() still returns true until the next call of
`XLOGShmemInit()` even if the data node was promoted.
`XLogWalRcvSendHSFeedback()` is the only caller of HotStandbyActive,
it's probably not covered by the test cases.
Is it the expected behavior or a bug in postgres? Probably a bug.
I haven't much knowledge of hot-standby, a simple fix might be
to set XLogCtl->SharedHotStandbyActive to false when
the recovery process almost finishes. See the attachment.
Regards,
Hao Wu
Attachment | Content-Type | Size |
---|---|---|
fix-hot-standby.diff | application/octet-stream | 463 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2021-03-12 02:45:50 | Re: Allow batched insert during cross-partition updates |
Previous Message | Tom Lane | 2021-03-12 01:59:48 | Re: Hybrid Hash/Nested Loop joins and caching results from subplans |