* SOLR-4003: The SolrZKClient clean method should not try and clear zk paths that start with /zookeeper, as this can fail and stop the removal of further nodes. (Mark Miller)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1408831 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-11-13 16:56:27 +00:00
parent 0b22d0b4a6
commit 27181e53a0
3 changed files with 31 additions and 0 deletions

View File

@ -182,6 +182,9 @@ Bug Fixes
* SOLR-4036: field aliases in fl should not cause properties of target field
to be used. (Martin Koch, yonik)
* SOLR-4003: The SolrZKClient clean method should not try and clear zk paths
that start with /zookeeper, as this can fail and stop the removal of
further nodes. (Mark Miller)
Other Changes
----------------------

View File

@ -71,6 +71,32 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
zkClient.close();
server.shutdown();
}
public void testClean() throws Exception {
String zkDir = dataDir.getAbsolutePath() + File.separator
+ "zookeeper/server1/data";
ZkTestServer server = null;
server = new ZkTestServer(zkDir);
server.run();
AbstractZkTestCase.tryCleanSolrZkNode(server.getZkHost());
SolrZkClient zkClient = new SolrZkClient(server.getZkHost(),
AbstractZkTestCase.TIMEOUT);
zkClient.makePath("/test/path/here", true);
zkClient.makePath("/zz/path/here", true);
zkClient.clean("/");
assertFalse(zkClient.exists("/test", true));
assertFalse(zkClient.exists("/zz", true));
zkClient.close();
server.shutdown();
}
public void testReconnect() throws Exception {
String zkDir = dataDir.getAbsolutePath() + File.separator

View File

@ -590,6 +590,8 @@ public class SolrZkClient {
return;
}
for (String string : children) {
// we can't clean the built-in zookeeper node
if (path.equals("/") && string.equals("zookeeper")) continue;
if (path.equals("/")) {
clean(path + string);
} else {