Refactor write_sync_state() (#2669)

Make it return the new `SyncState` object in order to avoid reading the new cluster state in the Ha.process_sync_replication().

Now it is a small optimization, but it will become very handy in the quorum commit feature.
This commit is contained in:
Alexander Kukushkin
2023-05-11 09:58:15 +02:00
committed by GitHub
parent 13164daf28
commit 7941c86775
14 changed files with 110 additions and 85 deletions
+1 -1
View File
@@ -338,7 +338,7 @@ class TestEtcd(unittest.TestCase):
self.assertTrue(self.etcd.watch(None, 1))
def test_sync_state(self):
self.assertFalse(self.etcd.write_sync_state('leader', None))
self.assertIsNone(self.etcd.write_sync_state('leader', None))
self.assertFalse(self.etcd.delete_sync_state())
def test_set_history_value(self):