You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2020/04/14 01:58:16 UTC

[helix] branch helix-1.0.0 updated (c2f3c08 -> 5b8297f)

This is an automated email from the ASF dual-hosted git repository.

jxue pushed a change to branch helix-1.0.0
in repository https://gitbox.apache.org/repos/asf/helix.git.


    from c2f3c08  Fix ClusterAccessor::createCluster wrt CloudConfig (#937)
     add adebe17  Add MetadataStoreRoutingData interface and TrieRoutingData class to helix-rest
     add 1323b25  Enable two test runs with multiZk system property (#710)
     add 2eaf882  Upgrade AbstractTestClass with multi-ZK support in helix-rest (#717)
     add c967c7c  Upgrade ZkTestBase with multi-ZK support in helix-core (#712)
     add d5a042d  Add MockMetadataStoreDirectoryServer (#719)
     add a4edbd2  Add MetadataStoreRoutingDataReader interface and ZkRoutingDataReader class to helix-rest (#714)
     add 08949f8  Add MetadataStoreDirectory and ZkMetadataStoreDirectory (#720)
     add 15cc55e  Add TrieRoutingData constructor (#731)
     add 661729b  Add MetadataStoreRoutingDataWriter with DistributedLeaderElection (#727)
     add c6504f3  Add REST read endpoints to Helix Rest to provide resource access to metadata store directory (#744)
     add 527c215  Rebase ZooScalability from upstream master
     add ab4f41e  Implement getAllMappingUnderPath and getMetadataStoreRealm in ZkMetadataStoreDirectory
     add e960917  Add write REST endpoints to helix rest for metadata store directory (#757)
     add 7512cfd  Add RealmAwareZkClient and RealmAwareZkClientFactory interfaces (#745)
     add c990679  Add validation logic to MSD write operations (#759)
     add 01ae06a  Create metadata-store-directory-common module (#771)
     add 6e4f27d  Fix tests in apache/zooscalability and rebase from apache/master (#787)
     add 642ee20  Add DedicatedZkClient and update DedicatedZkClientFactory (#765)
     add df6453e  Add REST read endpoints to helix-rest for metadata store directory (#761)
     add 65afec0  [helix-rest] Add endpoint to get namespace routing data (#799)
     add 6f9c5c9  Add HttpRoutingDataReader (#775)
     add f180cc9  Add getShardingKeyInPath to MetadataStoreRoutingData (#817)
     add 3af4c1f  Implement request forwarding for ZkRoutingDataWriter (#788)
     add 6b2a6ff  Fix InvalidRoutingData error message in tests (#821)
     add fbddb11  Update bump-up.command and ivy imports (#824)
     add 0980063  Add SharedZkClient/InnerSharedZkClient implementation (#796)
     add c9a9b7e  Improve MetadataStoreDirectoryAccessor endpoints and fix bugs in ZkRoutingDataReader/Writer
     add add11db  Make MSDS endpoint configurable for HttpRoutingDataReader (#836)
     add f645496  Add FederatedZkClient (#789)
     add 7d46f2a  Make ConfigAccessor and ZkUtil realm-aware (#838)
     add 1f0d278  Implement setRoutingData for MetadataStoreDirectoryService (#844)
     add c7ab0f2  Make RealmAwareZkClient implementations use HttpRoutingDataReader for routing data (#819)
     add 45f0989  Instrument ConfigAccessor's constructors (#856)
     add b01e804  Add rerunFailingTestsCount config to surefire-plugin (#865)
     add 7b57e9e  Make ClusterSetup realm-aware (#861)
     add 92aa631  Make ZkCacheBaseDataAccessor and ZkHelixPropertyStore realm-aware (#863)
     add 6e6862b  Make ZkHelixClusterVerifier and its child classes realm-aware (#867)
     add 73ccbc9  Make ZkBaseDataAccessor realm-aware (#855)
     add 289085f  Make ZKHelixAdmin and ZKHelixManager Realm-aware (#846)
     add 56ebbd1  Reformat ZkBaseDataAccessor (#893)
     add ef027a9  Update listClusters() in ZkHelixAdmin (#895)
     add 7184988  Make ZkBucketDataAccessor realm-aware (#894)
     add f90b194  Make ZkUtil realm-aware (#896)
     add 8523baa  Add integration tests for Helix Java APIs (#892)
     add b16ac22  Fix setRoutingData boolean handling; fix leader forwarding url construction (#902)
     add e3f751c  Use Java Generics and inheritance to reduce duplicate code in Helix API Builders (#899)
     add 2d310f3  Make Helix REST realm-aware (#908)
     add b7f6f3c  Make multiZkEnabled configurable in HelixRestNamespace (#915)
     add e303ef2  Fix getClusters() in ZKHelixAdmin for multi-zk mode (#916)
     add 9381a80  Fix MetadataStoreDirectory routing data cache refresh bug (#933)
     add 66c9964  Fix flaky resource accessor tests (#935)
     add 2e9ac43  Change thread pool used for TTL-based GC in ZkBucketDataAccessor (#945)
     add b8f22fd  Add integration test for Helix Java APIs using different MSDS endpoints (#948)
     new 5b8297f  Fix TestCrushAutoRebalanceNonRack failure of dropping instance

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bump-up.command                                    |  19 +
 .../java/org/apache/helix/SystemPropertyKeys.java  |  21 +
 .../main/java/org/apache/helix/ConfigAccessor.java |  49 +-
 .../java/org/apache/helix/SystemPropertyKeys.java  |  70 --
 .../apache/helix/manager/zk/CallbackHandler.java   |   7 +-
 .../manager/zk/GenericBaseDataAccessorBuilder.java | 145 ++++
 .../helix/manager/zk/GenericZkHelixApiBuilder.java | 139 ++++
 .../helix/manager/zk/ParticipantManager.java       |   7 +-
 .../org/apache/helix/manager/zk/ZKHelixAdmin.java  | 178 +++--
 .../apache/helix/manager/zk/ZKHelixManager.java    | 106 ++-
 .../java/org/apache/helix/manager/zk/ZKUtil.java   | 103 +--
 .../helix/manager/zk/ZkBaseDataAccessor.java       | 412 +++++++-----
 .../helix/manager/zk/ZkBucketDataAccessor.java     |  47 +-
 .../helix/manager/zk/ZkCacheBaseDataAccessor.java  | 106 +--
 .../helix/manager/zk/client/SharedZkClient.java    |  16 +-
 .../java/org/apache/helix/task/TaskDriver.java     |  10 +-
 .../java/org/apache/helix/tools/ClusterSetup.java  |  71 +-
 .../BestPossibleExternalViewVerifier.java          |  78 ++-
 .../ClusterVerifiers/ClusterLiveNodesVerifier.java |  32 +-
 .../StrictMatchExternalViewVerifier.java           |  66 +-
 .../ClusterVerifiers/ZkHelixClusterVerifier.java   | 119 +++-
 .../src/test/java/org/apache/helix/TestHelper.java |   5 +-
 .../test/java/org/apache/helix/ZkTestHelper.java   |  21 +-
 .../java/org/apache/helix/common/ZkTestBase.java   |  75 ++-
 .../helix/integration/TestEnableCompression.java   |  53 +-
 .../integration/TestResourceGroupEndtoEnd.java     |   3 +-
 .../controller/TestControllerLeadershipChange.java |   4 +-
 .../manager/ClusterControllerManager.java          |   3 +-
 .../manager/ClusterDistributedController.java      |   3 +-
 .../manager/MockParticipantManager.java            |   3 +-
 .../helix/integration/manager/ZkTestManager.java   |   5 +-
 .../multizk/TestMultiZkHelixJavaApis.java          | 732 +++++++++++++++++++++
 .../TestCrushAutoRebalanceNonRack.java             |  14 +-
 .../helix/integration/task/WorkflowGenerator.java  |  27 +-
 .../apache/helix/manager/zk/TestHandleSession.java |   5 +-
 .../helix/manager/zk/TestZkBaseDataAccessor.java   |  20 +
 .../apache/helix/manager/zk/TestZkHelixAdmin.java  |  37 +-
 helix-rest/pom.xml                                 |   5 +
 .../helix/rest/common/HelixRestNamespace.java      |  38 +-
 ...ContextPropertyKeys.java => HttpConstants.java} |  15 +-
 .../org/apache/helix/rest/common/ServletType.java  |   7 +-
 .../rest/metadatastore/MetadataStoreDirectory.java | 137 ++++
 .../metadatastore/ZkMetadataStoreDirectory.java    | 374 +++++++++++
 .../accessor/MetadataStoreRoutingDataReader.java   |  50 ++
 .../accessor/MetadataStoreRoutingDataWriter.java   |  74 +++
 .../accessor/ZkRoutingDataReader.java              | 160 +++++
 .../accessor/ZkRoutingDataWriter.java              | 428 ++++++++++++
 .../concurrency/ZkDistributedLeaderElection.java   | 141 ++++
 .../datamodel/MetadataStoreShardingKey.java        |  61 ++
 .../MetadataStoreShardingKeysByRealm.java          |  56 ++
 .../apache/helix/rest/server/HelixRestMain.java    |   8 +-
 .../apache/helix/rest/server/HelixRestServer.java  |   5 +-
 .../apache/helix/rest/server/ServerContext.java    | 305 +++++++--
 .../resources/helix/AbstractHelixResource.java     |  14 +-
 .../server/resources/helix/ClusterAccessor.java    |  16 +-
 .../resources/helix/PropertyStoreAccessor.java     |   6 +-
 .../server/resources/helix/ResourceAccessor.java   |  10 +-
 .../MetadataStoreDirectoryAccessor.java            | 392 +++++++++++
 .../resources/zookeeper/ZooKeeperAccessor.java     |  19 +-
 .../TestZkMetadataStoreDirectory.java              | 375 +++++++++++
 .../accessor/TestZkRoutingDataReader.java          | 136 ++++
 .../accessor/TestZkRoutingDataWriter.java          | 223 +++++++
 .../integration/TestRoutingDataUpdate.java         | 176 +++++
 .../helix/rest/server/AbstractTestClass.java       | 179 +++--
 .../MetadataStoreDirectoryAccessorTestBase.java    | 149 +++++
 .../rest/server/TestMSDAccessorLeaderElection.java | 261 ++++++++
 .../server/TestMetadataStoreDirectoryAccessor.java | 516 +++++++++++++++
 .../helix/rest/server/TestResourceAccessor.java    |  27 +
 .../mock/MockMetadataStoreDirectoryAccessor.java   | 124 ++++
 .../LICENSE                                        |   0
 .../NOTICE                                         |   0
 ...adata-store-directory-common-0.9.2-SNAPSHOT.ivy |   8 +-
 .../pom.xml                                        |  62 +-
 .../src/assemble/assembly.xml                      |   6 +-
 .../src/main/config/log4j.properties               |   0
 .../msdcommon/callback/RoutingDataListener.java    |  13 +-
 .../constant/MetadataStoreRoutingConstants.java    |  95 +++
 .../datamodel/MetadataStoreRoutingData.java        |  78 +++
 .../helix/msdcommon/datamodel/TrieRoutingData.java | 327 +++++++++
 .../exception/InvalidRoutingDataException.java     |  12 +-
 .../mock/MockMetadataStoreDirectoryServer.java     | 161 +++++
 .../helix/msdcommon/util/ZkValidationUtil.java     |  34 +-
 .../src/test/conf/testng.xml                       |   2 +-
 .../helix/msdcommon/constant/TestConstants.java    |  23 +-
 .../msdcommon/datamodel/TestTrieRoutingData.java   | 346 ++++++++++
 .../mock/TestMockMetadataStoreDirectoryServer.java | 115 ++++
 .../src/test/resources/log4j.properties            |   0
 pom.xml                                            |   3 +-
 zookeeper-api/pom.xml                              |  16 +
 .../helix/zookeeper/api/client/HelixZkClient.java  | 131 ++++
 .../zookeeper/api/client/RealmAwareZkClient.java   | 231 +++++--
 .../{HelixZkClient.java => ZkClientType.java}      |  24 +-
 .../api/factory/RealmAwareZkClientFactory.java     |  33 +
 .../zookeeper/impl/client/DedicatedZkClient.java   | 504 ++++++++++++++
 .../zookeeper/impl/client/FederatedZkClient.java   | 345 ++++++++--
 .../zookeeper/impl/client/SharedZkClient.java      | 547 +++++++++++++--
 .../impl/factory/DedicatedZkClientFactory.java     |  16 +-
 .../impl/factory/HelixZkClientFactory.java         |   5 +-
 .../impl/factory/SharedZkClientFactory.java        | 114 +++-
 .../zookeeper/util/HttpRoutingDataReader.java      | 197 ++++++
 zookeeper-api/src/test/conf/testng.xml             |   4 +-
 .../helix/zookeeper/constant/TestConstants.java    |  45 ++
 .../apache/helix/zookeeper/impl/ZkTestBase.java    | 148 +++++
 .../client/RealmAwareZkClientFactoryTestBase.java  | 180 +++++
 .../impl/client/RealmAwareZkClientTestBase.java    |  66 ++
 .../impl/client/TestDedicatedZkClient.java         |  25 +-
 .../impl/client/TestFederatedZkClient.java         | 283 ++++++++
 .../zookeeper/impl/client/TestSharedZkClient.java  |  69 ++
 .../zookeeper/util/TestHttpRoutingDataReader.java  | 120 ++++
 zookeeper-api/zookeeper-api-0.9.2-SNAPSHOT.ivy     |   1 +
 110 files changed, 10672 insertions(+), 1015 deletions(-)
 delete mode 100644 helix-core/src/main/java/org/apache/helix/SystemPropertyKeys.java
 create mode 100644 helix-core/src/main/java/org/apache/helix/manager/zk/GenericBaseDataAccessorBuilder.java
 create mode 100644 helix-core/src/main/java/org/apache/helix/manager/zk/GenericZkHelixApiBuilder.java
 create mode 100644 helix-core/src/test/java/org/apache/helix/integration/multizk/TestMultiZkHelixJavaApis.java
 copy helix-rest/src/main/java/org/apache/helix/rest/common/{ContextPropertyKeys.java => HttpConstants.java} (79%)
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/MetadataStoreDirectory.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/MetadataStoreRoutingDataReader.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/MetadataStoreRoutingDataWriter.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/ZkRoutingDataReader.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/accessor/ZkRoutingDataWriter.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/concurrency/ZkDistributedLeaderElection.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/datamodel/MetadataStoreShardingKey.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/metadatastore/datamodel/MetadataStoreShardingKeysByRealm.java
 create mode 100644 helix-rest/src/main/java/org/apache/helix/rest/server/resources/metadatastore/MetadataStoreDirectoryAccessor.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/metadatastore/TestZkMetadataStoreDirectory.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/metadatastore/accessor/TestZkRoutingDataReader.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/metadatastore/accessor/TestZkRoutingDataWriter.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/metadatastore/integration/TestRoutingDataUpdate.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/server/MetadataStoreDirectoryAccessorTestBase.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/server/TestMSDAccessorLeaderElection.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/server/TestMetadataStoreDirectoryAccessor.java
 create mode 100644 helix-rest/src/test/java/org/apache/helix/rest/server/mock/MockMetadataStoreDirectoryAccessor.java
 copy {helix-rest => metadata-store-directory-common}/LICENSE (100%)
 copy {helix-rest => metadata-store-directory-common}/NOTICE (100%)
 copy helix-rest/helix-rest-0.9.2-SNAPSHOT.ivy => metadata-store-directory-common/metadata-store-directory-common-0.9.2-SNAPSHOT.ivy (88%)
 copy {zookeeper-api => metadata-store-directory-common}/pom.xml (65%)
 copy {helix-admin-webapp => metadata-store-directory-common}/src/assemble/assembly.xml (88%)
 copy {zookeeper-api => metadata-store-directory-common}/src/main/config/log4j.properties (100%)
 copy helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/IZkStateListener.java => metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/callback/RoutingDataListener.java (78%)
 create mode 100644 metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/constant/MetadataStoreRoutingConstants.java
 create mode 100644 metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/datamodel/MetadataStoreRoutingData.java
 create mode 100644 metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/datamodel/TrieRoutingData.java
 copy helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/IZkStateListener.java => metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/exception/InvalidRoutingDataException.java (71%)
 create mode 100644 metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/mock/MockMetadataStoreDirectoryServer.java
 copy helix-core/src/main/java/org/apache/helix/api/cloud/CloudInstanceInformation.java => metadata-store-directory-common/src/main/java/org/apache/helix/msdcommon/util/ZkValidationUtil.java (64%)
 copy {zookeeper-api => metadata-store-directory-common}/src/test/conf/testng.xml (94%)
 copy helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportCollector.java => metadata-store-directory-common/src/test/java/org/apache/helix/msdcommon/constant/TestConstants.java (59%)
 create mode 100644 metadata-store-directory-common/src/test/java/org/apache/helix/msdcommon/datamodel/TestTrieRoutingData.java
 create mode 100644 metadata-store-directory-common/src/test/java/org/apache/helix/msdcommon/mock/TestMockMetadataStoreDirectoryServer.java
 copy {zookeeper-api => metadata-store-directory-common}/src/test/resources/log4j.properties (100%)
 copy zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/{HelixZkClient.java => ZkClientType.java} (55%)
 create mode 100644 zookeeper-api/src/main/java/org/apache/helix/zookeeper/impl/client/DedicatedZkClient.java
 create mode 100644 zookeeper-api/src/main/java/org/apache/helix/zookeeper/util/HttpRoutingDataReader.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/constant/TestConstants.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/ZkTestBase.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/RealmAwareZkClientFactoryTestBase.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/RealmAwareZkClientTestBase.java
 copy helix-core/src/test/java/org/apache/helix/integration/task/TaskTestBase.java => zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestDedicatedZkClient.java (58%)
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestFederatedZkClient.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestSharedZkClient.java
 create mode 100644 zookeeper-api/src/test/java/org/apache/helix/zookeeper/util/TestHttpRoutingDataReader.java


[helix] 01/01: Fix TestCrushAutoRebalanceNonRack failure of dropping instance

Posted by jx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jxue pushed a commit to branch helix-1.0.0
in repository https://gitbox.apache.org/repos/asf/helix.git

commit 5b8297f4d2a15584443abd89926cb2e3e60af908
Author: Huizhi Lu <ih...@gmail.com>
AuthorDate: Mon Apr 13 13:25:20 2020 -0700

    Fix TestCrushAutoRebalanceNonRack failure of dropping instance
---
 .../org/apache/helix/manager/zk/ZKHelixAdmin.java  | 10 +++---
 .../helix/manager/zk/ZkBaseDataAccessor.java       |  5 +--
 .../TestCrushAutoRebalanceNonRack.java             | 14 +++++++-
 .../helix/manager/zk/TestZkBaseDataAccessor.java   | 20 ++++++++++++
 .../apache/helix/manager/zk/TestZkHelixAdmin.java  | 37 +++++++++++++++++++++-
 5 files changed, 78 insertions(+), 8 deletions(-)

diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
index bc62b18..14f73f9 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
@@ -83,6 +83,7 @@ import org.apache.helix.util.RebalanceUtil;
 import org.apache.helix.zookeeper.api.client.HelixZkClient;
 import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
 import org.apache.helix.zookeeper.datamodel.ZNRecord;
+import org.apache.helix.zookeeper.exception.ZkClientException;
 import org.apache.helix.zookeeper.impl.client.FederatedZkClient;
 import org.apache.helix.zookeeper.impl.factory.SharedZkClientFactory;
 import org.apache.helix.zookeeper.util.HttpRoutingDataReader;
@@ -225,7 +226,7 @@ public class ZKHelixAdmin implements HelixAdmin {
       try {
         _zkClient.deleteRecursively(instancePath);
         return;
-      } catch (HelixException e) {
+      } catch (ZkClientException e) {
         if (retryCnt < 3 && e.getCause() instanceof ZkException && e.getCause()
             .getCause() instanceof KeeperException.NotEmptyException) {
           // Racing condition with controller's persisting node history, retryable.
@@ -235,9 +236,10 @@ public class ZKHelixAdmin implements HelixAdmin {
               instanceConfig.getInstanceName(), e.getCause().getMessage());
           retryCnt++;
         } else {
-          logger.error("Failed to drop instance {} (not retryable).",
-              instanceConfig.getInstanceName(), e.getCause());
-          throw e;
+          String errorMessage = "Failed to drop instance: " + instanceConfig.getInstanceName()
+              + ". Retry times: " + retryCnt;
+          logger.error(errorMessage, e);
+          throw new HelixException(errorMessage, e);
         }
       }
     }
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
index a7596f4..d5ea20b 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
@@ -40,6 +40,7 @@ import org.apache.helix.util.HelixUtil;
 import org.apache.helix.zookeeper.api.client.HelixZkClient;
 import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
 import org.apache.helix.zookeeper.datamodel.ZNRecord;
+import org.apache.helix.zookeeper.exception.ZkClientException;
 import org.apache.helix.zookeeper.impl.client.FederatedZkClient;
 import org.apache.helix.zookeeper.impl.factory.DedicatedZkClientFactory;
 import org.apache.helix.zookeeper.impl.factory.SharedZkClientFactory;
@@ -703,8 +704,8 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T> {
           e.getMessage());
       try {
         _zkClient.deleteRecursively(path);
-      } catch (HelixException he) {
-        LOG.error("Failed to delete {} recursively with opts {}.", path, options, he);
+      } catch (ZkClientException zce) {
+        LOG.error("Failed to delete {} recursively with opts {}.", path, options, zce);
         return false;
       }
     }
diff --git a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
index 5b7d083..f889074 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/rebalancer/CrushRebalancers/TestCrushAutoRebalanceNonRack.java
@@ -28,11 +28,15 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.helix.ConfigAccessor;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.InstanceType;
+import org.apache.helix.TestHelper;
 import org.apache.helix.controller.rebalancer.strategy.CrushEdRebalanceStrategy;
 import org.apache.helix.controller.rebalancer.strategy.CrushRebalanceStrategy;
 import org.apache.helix.integration.common.ZkStandAloneCMTestBase;
 import org.apache.helix.integration.manager.ClusterControllerManager;
 import org.apache.helix.integration.manager.MockParticipantManager;
+import org.apache.helix.manager.zk.ZKHelixDataAccessor;
 import org.apache.helix.model.BuiltInStateModelDefinitions;
 import org.apache.helix.model.ClusterConfig;
 import org.apache.helix.model.ExternalView;
@@ -42,6 +46,7 @@ import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.tools.ClusterVerifiers.HelixClusterVerifier;
 import org.apache.helix.tools.ClusterVerifiers.StrictMatchExternalViewVerifier;
 import org.apache.helix.tools.ClusterVerifiers.ZkHelixClusterVerifier;
+import org.apache.helix.util.InstanceValidationUtil;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.AfterMethod;
@@ -242,13 +247,20 @@ public class TestCrushAutoRebalanceNonRack extends ZkStandAloneCMTestBase {
     enablePersistBestPossibleAssignment(_gZkClient, CLUSTER_NAME, true);
 
     // shutdown participants, keep only two left
+    HelixDataAccessor helixDataAccessor =
+        new ZKHelixDataAccessor(CLUSTER_NAME, InstanceType.PARTICIPANT, _baseAccessor);
     for (int i = 2; i < _participants.size(); i++) {
       MockParticipantManager p = _participants.get(i);
       p.syncStop();
       _gSetupTool.getClusterManagementTool().enableInstance(CLUSTER_NAME, p.getInstanceName(),
           false);
+      Assert.assertTrue(TestHelper.verify(() -> {
+        _gSetupTool.getClusterManagementTool()
+            .enableInstance(CLUSTER_NAME, p.getInstanceName(), false);
+        return !InstanceValidationUtil.isEnabled(helixDataAccessor, p.getInstanceName())
+            && !InstanceValidationUtil.isAlive(helixDataAccessor, p.getInstanceName());
+      }, TestHelper.WAIT_DURATION), "Instance should be disabled and offline");
       _gSetupTool.dropInstanceFromCluster(CLUSTER_NAME, p.getInstanceName());
-
     }
 
     int j = 0;
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java
index 3e03125..9e56b6e 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkBaseDataAccessor.java
@@ -30,15 +30,19 @@ import org.apache.helix.AccessOption;
 import org.apache.helix.BaseDataAccessor;
 import org.apache.helix.PropertyPathBuilder;
 import org.apache.helix.TestHelper;
+import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
 import org.apache.helix.zookeeper.datamodel.ZNRecord;
 import org.apache.helix.zookeeper.datamodel.ZNRecordUpdater;
 import org.apache.helix.ZkUnitTestBase;
 import org.apache.helix.manager.zk.ZkBaseDataAccessor.AccessResult;
 import org.apache.helix.manager.zk.ZkBaseDataAccessor.RetCode;
+import org.apache.helix.zookeeper.exception.ZkClientException;
 import org.apache.helix.zookeeper.zkclient.DataUpdater;
+import org.apache.helix.zookeeper.zkclient.exception.ZkException;
 import org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError;
 import org.apache.helix.zookeeper.zkclient.serialize.ZkSerializer;
 import org.apache.zookeeper.data.Stat;
+import org.mockito.Mockito;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.Test;
@@ -343,6 +347,22 @@ public class TestZkBaseDataAccessor extends ZkUnitTestBase {
     Assert.assertNotNull(getRecord);
     Assert.assertEquals(getRecord.getId(), "msg_0");
 
+    // Tests that ZkClientException thrown from ZkClient should be caught
+    // and remove() should return false.
+    RealmAwareZkClient mockZkClient = Mockito.mock(RealmAwareZkClient.class);
+    Mockito.doThrow(new ZkException("Failed to delete " + path)).when(mockZkClient)
+        .delete(path);
+    Mockito.doThrow(new ZkClientException("Failed to recursively delete " + path)).when(mockZkClient)
+        .deleteRecursively(path);
+    ZkBaseDataAccessor<ZNRecord> accessorMock =
+        new ZkBaseDataAccessor<>(mockZkClient);
+    try {
+      Assert.assertFalse(accessorMock.remove(path, AccessOption.PERSISTENT),
+          "Should return false because ZkClientException is thrown");
+    } catch (ZkClientException e) {
+      Assert.fail("Should not throw ZkClientException because it should be caught.");
+    }
+
     success = accessor.remove(path, 0);
     Assert.assertTrue(success);
     Assert.assertFalse(_gZkClient.exists(path));
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
index 234f2c3..639a4b1 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
@@ -41,6 +41,7 @@ import org.apache.helix.PropertyKey;
 import org.apache.helix.PropertyPathBuilder;
 import org.apache.helix.PropertyType;
 import org.apache.helix.TestHelper;
+import org.apache.helix.zookeeper.api.client.RealmAwareZkClient;
 import org.apache.helix.zookeeper.datamodel.ZNRecord;
 import org.apache.helix.ZkUnitTestBase;
 import org.apache.helix.controller.rebalancer.waged.WagedRebalancer;
@@ -48,7 +49,6 @@ import org.apache.helix.examples.MasterSlaveStateModelFactory;
 import org.apache.helix.integration.manager.MockParticipantManager;
 import org.apache.helix.model.ClusterConfig;
 import org.apache.helix.cloud.constants.CloudProvider;
-import org.apache.helix.examples.MasterSlaveStateModelFactory;
 import org.apache.helix.model.CloudConfig;
 import org.apache.helix.model.ClusterConstraints;
 import org.apache.helix.model.ClusterConstraints.ConstraintAttribute;
@@ -66,8 +66,12 @@ import org.apache.helix.model.builder.ConstraintItemBuilder;
 import org.apache.helix.model.builder.HelixConfigScopeBuilder;
 import org.apache.helix.participant.StateMachineEngine;
 import org.apache.helix.tools.StateModelConfigGenerator;
+import org.apache.helix.zookeeper.exception.ZkClientException;
+import org.apache.helix.zookeeper.zkclient.exception.ZkException;
+import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.data.Stat;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.mockito.Mockito;
 import org.testng.Assert;
 import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeClass;
@@ -191,6 +195,36 @@ public class TestZkHelixAdmin extends ZkUnitTestBase {
       Assert.fail("HelixManager failed disconnecting");
     }
 
+    // Tests that ZkClientException thrown from ZkClient should be caught
+    // and it should be converted HelixException to be rethrown
+    String instancePath = PropertyPathBuilder.instance(clusterName, config.getInstanceName());
+    String instanceConfigPath = PropertyPathBuilder.instanceConfig(clusterName, instanceName);
+    String liveInstancePath = PropertyPathBuilder.liveInstance(clusterName, instanceName);
+    RealmAwareZkClient mockZkClient = Mockito.mock(RealmAwareZkClient.class);
+    // Mock the exists() method to let dropInstance() reach deleteRecursively().
+    Mockito.when(mockZkClient.exists(instanceConfigPath)).thenReturn(true);
+    Mockito.when(mockZkClient.exists(instancePath)).thenReturn(true);
+    Mockito.when(mockZkClient.exists(liveInstancePath)).thenReturn(false);
+    Mockito.doThrow(new ZkClientException("ZkClientException: failed to delete " + instancePath,
+        new ZkException("ZkException: failed to delete " + instancePath,
+            new KeeperException.NotEmptyException(
+                "NotEmptyException: directory" + instancePath + " is not empty"))))
+        .when(mockZkClient).deleteRecursively(instancePath);
+
+    HelixAdmin helixAdminMock = new ZKHelixAdmin(mockZkClient);
+    try {
+      helixAdminMock.dropInstance(clusterName, config);
+      Assert.fail("Should throw HelixException");
+    } catch (HelixException expected) {
+      // This exception is expected because it is converted from ZkClientException and rethrown.
+      Assert.assertEquals(expected.getMessage(),
+          "Failed to drop instance: " + config.getInstanceName() + ". Retry times: 3");
+    } catch (ZkClientException e) {
+      if (e.getMessage().equals("ZkClientException: failed to delete " + instancePath)) {
+        Assert.fail("Should not throw ZkClientException because it should be caught.");
+      }
+    }
+
     tool.dropInstance(clusterName, config); // correctly drop the instance
 
     try {
@@ -211,6 +245,7 @@ public class TestZkHelixAdmin extends ZkUnitTestBase {
     } catch (HelixException e) {
       // OK
     }
+
     ZNRecord stateModelRecord = new ZNRecord("id1");
     try {
       tool.addStateModelDef(clusterName, "id1", new StateModelDefinition(stateModelRecord));