mirror of https://github.com/apache/lucene.git
SOLR-12823: fix failures in CloudHttp2SolrClientTest CloudSolrClientTest TestCloudSolrClientConnections (#1565)
Co-authored-by: Ilan Ginzburg <iginzburg@salesforce.com>
This commit is contained in:
parent
07a203628e
commit
b4dcbfa3de
|
@ -476,27 +476,32 @@ public class ZkStateReader implements SolrCloseable {
|
||||||
|
|
||||||
log.debug("Updating cluster state from ZooKeeper... ");
|
log.debug("Updating cluster state from ZooKeeper... ");
|
||||||
|
|
||||||
// on reconnect of SolrZkClient force refresh and re-add watches.
|
try {
|
||||||
loadClusterProperties();
|
// on reconnect of SolrZkClient force refresh and re-add watches.
|
||||||
refreshLiveNodes(new LiveNodeWatcher());
|
loadClusterProperties();
|
||||||
refreshCollections();
|
refreshLiveNodes(new LiveNodeWatcher());
|
||||||
refreshCollectionList(new CollectionsChildWatcher());
|
refreshCollections();
|
||||||
refreshAliases(aliasesManager);
|
refreshCollectionList(new CollectionsChildWatcher());
|
||||||
|
refreshAliases(aliasesManager);
|
||||||
|
|
||||||
if (securityNodeListener != null) {
|
if (securityNodeListener != null) {
|
||||||
addSecurityNodeWatcher(pair -> {
|
addSecurityNodeWatcher(pair -> {
|
||||||
ConfigData cd = new ConfigData();
|
ConfigData cd = new ConfigData();
|
||||||
cd.data = pair.first() == null || pair.first().length == 0 ? EMPTY_MAP : Utils.getDeepCopy((Map) fromJSON(pair.first()), 4, false);
|
cd.data = pair.first() == null || pair.first().length == 0 ? EMPTY_MAP : Utils.getDeepCopy((Map) fromJSON(pair.first()), 4, false);
|
||||||
cd.version = pair.second() == null ? -1 : pair.second().getVersion();
|
cd.version = pair.second() == null ? -1 : pair.second().getVersion();
|
||||||
securityData = cd;
|
securityData = cd;
|
||||||
securityNodeListener.run();
|
securityNodeListener.run();
|
||||||
|
});
|
||||||
|
securityData = getSecurityProps(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
collectionPropsObservers.forEach((k, v) -> {
|
||||||
|
collectionPropsWatchers.computeIfAbsent(k, PropsWatcher::new).refreshAndWatch(true);
|
||||||
});
|
});
|
||||||
securityData = getSecurityProps(true);
|
} catch (KeeperException.NoNodeException nne) {
|
||||||
|
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE,
|
||||||
|
"Cannot connect to cluster at " + zkClient.getZkServerAddress() + ": cluster not found/not ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
collectionPropsObservers.forEach((k, v) -> {
|
|
||||||
collectionPropsWatchers.computeIfAbsent(k, PropsWatcher::new).refreshAndWatch(true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSecurityNodeWatcher(final Callable<Pair<byte[], Stat>> callback)
|
private void addSecurityNodeWatcher(final Callable<Pair<byte[], Stat>> callback)
|
||||||
|
|
|
@ -777,7 +777,6 @@ public class CloudHttp2SolrClientTest extends SolrCloudTestCase {
|
||||||
public ExpectedException exception = ExpectedException.none();
|
public ExpectedException exception = ExpectedException.none();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12823")
|
|
||||||
public void testWrongZkChrootTest() throws IOException {
|
public void testWrongZkChrootTest() throws IOException {
|
||||||
|
|
||||||
exception.expect(SolrException.class);
|
exception.expect(SolrException.class);
|
||||||
|
|
|
@ -761,7 +761,6 @@ public class CloudSolrClientTest extends SolrCloudTestCase {
|
||||||
public ExpectedException exception = ExpectedException.none();
|
public ExpectedException exception = ExpectedException.none();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12823")
|
|
||||||
public void testWrongZkChrootTest() throws IOException {
|
public void testWrongZkChrootTest() throws IOException {
|
||||||
try (CloudSolrClient client = getCloudSolrClient(cluster.getZkServer().getZkAddress() + "/xyz/foo")) {
|
try (CloudSolrClient client = getCloudSolrClient(cluster.getZkServer().getZkAddress() + "/xyz/foo")) {
|
||||||
client.setZkClientTimeout(1000 * 60);
|
client.setZkClientTimeout(1000 * 60);
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.junit.Test;
|
||||||
public class TestCloudSolrClientConnections extends SolrTestCaseJ4 {
|
public class TestCloudSolrClientConnections extends SolrTestCaseJ4 {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12823")
|
|
||||||
public void testCloudClientCanConnectAfterClusterComesUp() throws Exception {
|
public void testCloudClientCanConnectAfterClusterComesUp() throws Exception {
|
||||||
|
|
||||||
// Start by creating a cluster with no jetties
|
// Start by creating a cluster with no jetties
|
||||||
|
@ -59,7 +58,6 @@ public class TestCloudSolrClientConnections extends SolrTestCaseJ4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12823")
|
|
||||||
public void testCloudClientUploads() throws Exception {
|
public void testCloudClientUploads() throws Exception {
|
||||||
|
|
||||||
Path configPath = getFile("solrj").toPath().resolve("solr/configsets/configset-2/conf");
|
Path configPath = getFile("solrj").toPath().resolve("solr/configsets/configset-2/conf");
|
||||||
|
|
Loading…
Reference in New Issue