[sheepdog] [PATCH 1/2] zookeeper: fix node_btree_clear()

Yunkai Zhang yunkai.me at gmail.com
Fri May 18 12:28:38 CEST 2012


From: Yunkai Zhang <qiushu.zyk at taobao.com>

reset zk_nr_nodes to 0 when clear node_btree

Signed-off-by: Yunkai Zhang <qiushu.zyk at taobao.com>
---
 sheep/cluster/zookeeper.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sheep/cluster/zookeeper.c b/sheep/cluster/zookeeper.c
index c21267c..3378535 100644
--- a/sheep/cluster/zookeeper.c
+++ b/sheep/cluster/zookeeper.c
@@ -377,6 +377,7 @@ static inline void node_btree_clear(void **btroot)
 {
 	tdestroy(*btroot, free);
 	*btroot = NULL;
+	nr_zk_nodes = 0;
 }
 
 static struct zk_node *node_btree_find(void **btroot, struct zk_node *znode)
-- 
1.7.7.6




More information about the sheepdog mailing list