Re:[BUG] standby node can not provide service even it replays alllog files
От | Thunder |
---|---|
Тема | Re:[BUG] standby node can not provide service even it replays alllog files |
Дата | |
Msg-id | 3f1cf8f7.6405.16ded602fce.Coremail.thunder1@126.com обсуждение исходный текст |
Ответ на | [BUG] standby node can not provide service even it replays all logfiles (Thunder <thunder1@126.com>) |
Ответы |
Re: [BUG] standby node can not provide service even it replays alllog files
|
Список | pgsql-hackers |
Can we fix this issue like the following patch?
$git diff src/backend/access/transam/xlog.c
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 49ae97d4459..0fbdf6fd64a 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8365,7 +8365,7 @@ CheckRecoveryConsistency(void)
* run? If so, we can tell postmaster that the database is consistent now,
* enabling connections.
*/
- if (standbyState == STANDBY_SNAPSHOT_READY &&
+ if ((standbyState == STANDBY_SNAPSHOT_READY || standbyState == STANDBY_SNAPSHOT_PENDING) &&
!LocalHotStandbyActive &&
reachedConsistency &&
IsUnderPostmaster)
At 2019-10-21 15:40:24, "Thunder" <thunder1@126.com> wrote:
Hi hackers,I found this issue when restart standby node and then try to connect it.It return "psql: FATAL: the database system is starting up".The steps to reproduce this issue.1. Create a session to run uncommit_trans.sql2. Create the other session to do checkpoint3. Restart standby node.4. standby node can not provide service even it has replayed all log files.I think the issue is in ProcArrayApplyRecoveryInfo function.The standby state is in STANDBY_SNAPSHOT_PENDING, but the lastOverflowedXid is not committed.Any idea to fix this issue?Thanks.
В списке pgsql-hackers по дате отправления: