mirror of https://github.com/apache/lucene.git
* 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:
parent
0b22d0b4a6
commit
27181e53a0
|
@ -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
|
||||
----------------------
|
||||
|
|
|
@ -72,6 +72,32 @@ public class ZkSolrClientTest extends AbstractSolrTestCase {
|
|||
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
|
||||
+ "zookeeper/server1/data";
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue