private void cleanupPropertyStore(String instance) {
    if(clusterMapConfig.clustermapDeleteDataFromDatanodeConfigInPropertyStoreCleanUpTask &&
        clusterMapConfig.clusterMapDataNodeConfigSourceType == DataNodeConfigSourceType.PROPERTY_STORE) {
        synchronized (helixAdministrationLock) {
          // Get the DataNodeConfig for the instance from the ZK
          DataNodeConfig dataNodeConfig = dataNodeConfigSource.get(instance);
          if (dataNodeConfig == null) { return;}

          /* We will first try to remove data from local DataNodeConfig object
             and then set it back in ZK based on configChanged flag
          */
          boolean configChanged;
          // Remove all sealed, stopped, partially sealed and disabled replicas from DataNodeConfig
          configChanged = TaskUtils.removeIfPresent(dataNodeConfig.getSealedReplicas());
          configChanged = TaskUtils.removeIfPresent(dataNodeConfig.getStoppedReplicas()) || configChanged;
          configChanged = TaskUtils.removeIfPresent(dataNodeConfig.getPartiallySealedReplicas()) || configChanged;
          configChanged = TaskUtils.removeIfPresent(dataNodeConfig.getDisabledReplicas()) || configChanged;
          Map<String, DataNodeConfig.DiskConfig> diskConfigs = dataNodeConfig.getDiskConfigs();

          // Remove all replicas for each disk in the DataNodeConfig
          for (DataNodeConfig.DiskConfig diskConfig : diskConfigs.values()) {
            configChanged = TaskUtils.removeIfPresent(diskConfig.getReplicaConfigs()) || configChanged;
          }
          // Only set the DatanodeConfig in ZK if it has changed
          if (configChanged) {
            if (dataNodeConfigSource.set(dataNodeConfig)) {
              logger.info("PropertyStore cleanup successful for instance = {}", instance);
              metrics.propertyStoreCleanUpSuccessCount.inc();
            } else {
              logger.error("PropertyStore cleanup failed for instance while setting config = {}", instance);
              metrics.propertyStoreCleanUpErrorCount.inc();
            }
          }
        }
    }
  }
Cleanup property store for the given instance
ambry-clustermap/src/main/java/com/github/ambry/clustermap/PropertyStoreCleanUpTask.java