зеркало из https://github.com/github/vitess-gh.git
fakezk: respect version in Delete.
This commit is contained in:
Родитель
28ece60773
Коммит
100325673a
|
@ -291,6 +291,9 @@ func (conn *zconn) Delete(zkPath string, version int) (err error) {
|
|||
if len(node.children) > 0 {
|
||||
return zkError(zookeeper.ZNOTEMPTY, "delete", zkPath)
|
||||
}
|
||||
if version != -1 && node.version != version {
|
||||
return zkError(zookeeper.ZBADVERSION, "delete", zkPath)
|
||||
}
|
||||
delete(parent.children, node.name)
|
||||
event := zookeeper.Event{
|
||||
Type: zookeeper.EVENT_DELETED,
|
||||
|
|
Загрузка…
Ссылка в новой задаче