mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
Broadcast before exiting sync safekeepers (#4700)
Recently we started doing sync-safekeepers before exiting compute_ctl, expecting that it will make next sync faster by skipping recovery. But recovery is still running in some cases (https://github.com/neondatabase/neon/pull/4574#issuecomment-1629256166) because of the lagging truncateLsn. This PR should help with updating truncateLsn.
This commit is contained in:
committed by
GitHub
parent
664d32eb7f
commit
3a1be9b246
@@ -2231,6 +2231,18 @@ HandleSafekeeperResponse(void)
|
||||
if (n_synced >= quorum)
|
||||
{
|
||||
/* All safekeepers synced! */
|
||||
|
||||
/*
|
||||
* Send empty message to broadcast latest truncateLsn to all safekeepers.
|
||||
* This helps to finish next sync-safekeepers eailier, by skipping recovery
|
||||
* step.
|
||||
*
|
||||
* We don't need to wait for response because it doesn't affect correctness,
|
||||
* and TCP should be able to deliver the message to safekeepers in case of
|
||||
* network working properly.
|
||||
*/
|
||||
BroadcastAppendRequest();
|
||||
|
||||
fprintf(stdout, "%X/%X\n", LSN_FORMAT_ARGS(propEpochStartLsn));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user