Skip to content

Commit

Permalink
better slots on dead iter
Browse files Browse the repository at this point in the history
  • Loading branch information
munakoiso committed Nov 15, 2024
1 parent d2420d1 commit 4ca0eed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def read_config(filename=None, options=None):
'certfile': None,
'ca_cert': None,
'verify_certs': 'no',
'drop_slot_countdown': 10,
'drop_slot_countdown': 300,
'replication_slots_polling': None,
'max_allowed_switchover_lag_ms': 60000,
},
Expand Down
1 change: 1 addition & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ def dead_iter(self, db_state, zk_state, is_actually_dead):
holder = self.zk.get_current_lock_holder()
if holder and holder != helpers.get_hostname():
if role == 'replica' and holder == last_primary:
self._acquire_replication_source_slot_lock(last_primary)
logging.info('Seems that primary has not changed but PostgreSQL is dead. Starting it.')
return self.db.start_postgresql()

Expand Down

0 comments on commit 4ca0eed

Please sign in to comment.