Optimize checkpoint after promote (#2114)

1. Avoid doing CHECKPOINT if `pg_control` is already updated.
2. Explicitly call ensure_checkpoint_after_promote() right after the bootstrap finished successfully.
This commit is contained in:
Alexander Kukushkin
2021-11-19 14:33:24 +01:00
committed by GitHub
parent fce889cd04
commit 17e523b175
4 changed files with 16 additions and 15 deletions
+1
View File
@@ -388,6 +388,7 @@ class Postgresql(object):
def pg_control_timeline(self):
try:
return int(self.controldata().get("Latest checkpoint's TimeLineID"))
except (TypeError, ValueError):
logger.exception('Failed to parse timeline from pg_controldata output')