mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix removal of keys on failed initialization.
The initialize key was checked against the value of the node name before removal, but it was changed recently to contain either an empty string, or cluster sysid. To fix this, the check for the previous value was simply removed: we can guarantee that the code path that removes the key is the one that created it.
This commit is contained in:
+1
-1
@@ -249,7 +249,7 @@ class Etcd(AbstractDCS):
|
||||
|
||||
@catch_etcd_errors
|
||||
def cancel_initialization(self):
|
||||
return self.retry(self.client.delete, self.initialize_path, prevValue=self._name)
|
||||
return self.retry(self.client.delete, self.initialize_path)
|
||||
|
||||
def watch(self, timeout):
|
||||
cluster = self.cluster
|
||||
|
||||
@@ -271,7 +271,7 @@ class ZooKeeper(AbstractDCS):
|
||||
|
||||
def _cancel_initialization(self):
|
||||
node = self.get_node(self.initialize_path)
|
||||
if node and node[0] == self._name:
|
||||
if node:
|
||||
self.client.delete(self.initialize_path, version=node[1].version)
|
||||
|
||||
def cancel_initialization(self):
|
||||
|
||||
Reference in New Issue
Block a user