Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfaa0550

Browse files
Remove rare corner case for data loss when triggering standby server.
If the standby was streaming when trigger file arrives, check also in thearchive for additional WAL files. This is a corner case since it isunlikely that we would trigger a failover while the master is stillavailable and sending data to standby, while at the same time running inarchive mode and also while the streaming standby has fallen behind archive.Someone would eventually be unlucky; we must plug all gaps however small.Fujii Masao
1 parent722bf70 commitfaa0550

File tree

1 file changed

+6
-1
lines changed
  • src/backend/access/transam

1 file changed

+6
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9619,7 +9619,7 @@ XLogPageRead(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt,
96199619
* five seconds like in the WAL file polling case below.
96209620
*/
96219621
if (CheckForStandbyTrigger())
9622-
gototriggered;
9622+
gotoretry;
96239623

96249624
/*
96259625
* Wait for more WAL to arrive, or timeout to be reached
@@ -9886,6 +9886,10 @@ static bool
98869886
CheckForStandbyTrigger(void)
98879887
{
98889888
structstatstat_buf;
9889+
staticbooltriggered= false;
9890+
9891+
if (triggered)
9892+
return true;
98899893

98909894
if (TriggerFile==NULL)
98919895
return false;
@@ -9896,6 +9900,7 @@ CheckForStandbyTrigger(void)
98969900
(errmsg("trigger file found: %s",TriggerFile)));
98979901
ShutdownWalRcv();
98989902
unlink(TriggerFile);
9903+
triggered= true;
98999904
return true;
99009905
}
99019906
return false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp