@@ -1626,7 +1626,7 @@ def on_shutdown(checkpoint_location: int, prev_location: int) -> None:
16261626 status ['released' ] = True
16271627
16281628 if mode == 'multisite' :
1629- on_shutdown = self .patroni .multisite .on_shutdown # pyright: ignore [reportAssignmentType] # noqa: F811
1629+ on_shutdown = self .patroni .multisite .on_shutdown # noqa: F811
16301630
16311631 def before_shutdown () -> None :
16321632 if self .state_handler .mpp_handler .is_coordinator ():
@@ -1643,7 +1643,7 @@ def before_shutdown() -> None:
16431643
16441644 # for demotion to a standby cluster we need shutdown checkpoint lsn to be written to optime, not the prev one
16451645 checkpoint_lsn , prev_lsn = self .state_handler .latest_checkpoint_locations () \
1646- if mode == 'graceful' else (None , None )
1646+ if mode in ( 'graceful' , 'multisite' ) else (None , None )
16471647
16481648 is_standby_leader = mode == 'demote-cluster' and not status ['released' ]
16491649 if is_standby_leader :
@@ -1660,8 +1660,7 @@ def before_shutdown() -> None:
16601660 time .sleep (2 ) # Give a time to somebody to take the leader lock
16611661
16621662 if mode == 'multisite' :
1663- self .patroni .multisite .on_shutdown (
1664- self .state_handler .latest_checkpoint_location (), None ) # pyright: ignore [reportArgumentType]
1663+ on_shutdown (checkpoint_lsn , prev_lsn ) # pyright: ignore [reportArgumentType] # noqa: F811
16651664
16661665 if mode == 'demote-cluster' :
16671666 if demote_cluster_with_archive :
0 commit comments