Skip to content

Commit

Permalink
Checkpoint on primary before switchover
Browse files Browse the repository at this point in the history
  • Loading branch information
munakoiso committed Sep 19, 2024
1 parent 9638676 commit 8f23506
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,7 @@ def _do_primary_switchover(self, zk_state):

# Attempt to shut down local PG instance.
# Failure is not critical.
self.db.checkpoint()
if self.db.stop_postgresql(timeout=limit) == 0:
lsn = self._cmd_manager.get_control_parameter(db_state['pgdata'], "REDO location")
self.zk.noexcept_write(self.zk.SWITCHOVER_LSN_PATH, lsn)
Expand Down

0 comments on commit 8f23506

Please sign in to comment.