mirror of https://github.com/apache/druid.git
Add comment to BrokerServerViewTest
Explain why we need to do explicit checks on existences of zNodes before we create them. Address issue: https://github.com/druid-io/druid/issues/1512
This commit is contained in:
parent
161c4ce288
commit
31502a920c
|
@ -374,6 +374,11 @@ public class BrokerServerViewTest extends CuratorTestBase
|
||||||
final String zNodePathAnnounce = ZKPaths.makePath(announcementsPath, server.getHost());
|
final String zNodePathAnnounce = ZKPaths.makePath(announcementsPath, server.getHost());
|
||||||
final String zNodePathSegment = ZKPaths.makePath(inventoryPath, server.getHost());
|
final String zNodePathSegment = ZKPaths.makePath(inventoryPath, server.getHost());
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Explicitly check whether the zNodes we are about to create exist or not,
|
||||||
|
* if exist, delete them to make sure we have a clean state on zookeeper.
|
||||||
|
* Address issue: https://github.com/druid-io/druid/issues/1512
|
||||||
|
*/
|
||||||
if (curator.checkExists().forPath(zNodePathAnnounce) != null) {
|
if (curator.checkExists().forPath(zNodePathAnnounce) != null) {
|
||||||
curator.delete().guaranteed().forPath(zNodePathAnnounce);
|
curator.delete().guaranteed().forPath(zNodePathAnnounce);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue