diff --git a/src/main.py b/src/main.py index e105998..4392c5b 100644 --- a/src/main.py +++ b/src/main.py @@ -1090,8 +1090,7 @@ def _attach_to_primary(self, new_primary, limit): return True def _handle_slots(self): - need_slots = self.config.getboolean('global', 'use_replication_slots') - if not need_slots: + if not self.config.getboolean('global', 'use_replication_slots'): return my_hostname = helpers.get_hostname() @@ -1143,8 +1142,7 @@ def _get_db_state(self): return state def _acquire_replication_source_lock(self, primary): - need_slots = self.config.getboolean('global', 'use_replication_slots') - if not need_slots: + if not self.config.getboolean('global', 'use_replication_slots'): return # We need to drop the slot in the old primary. # But we don't know who the primary was (probably there are many of them). @@ -1283,8 +1281,7 @@ def _promote(self): return True def _promote_handle_slots(self): - need_slots = self.config.getboolean('global', 'use_replication_slots') - if need_slots: + if self.config.getboolean('global', 'use_replication_slots'): if not self.zk.write(self.zk.FAILOVER_INFO_PATH, 'creating_slots'): logging.warning('Could not write failover state to ZK.')