Browse Source

YARN-11551. RM format-conf-store should delete all the content of ZKConfigStore (#5958)

Benjamin Teke 2 years ago
parent
commit
ebc32fbcaf

+ 3 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/conf/ZKConfigurationStore.java

@@ -64,6 +64,7 @@ public class ZKConfigurationStore extends YarnConfigurationStore {
   private static final String CONF_VERSION_PATH = "CONF_VERSION";
   private static final String NODEEXISTS_MSG = "Encountered NodeExists error."
       + " Skipping znode creation since another RM has already created it";
+  private String znodeParentPath;
   private String zkVersionPath;
   private String logsPath;
   private String confStorePath;
@@ -78,7 +79,7 @@ public class ZKConfigurationStore extends YarnConfigurationStore {
       RMContext rmContext) throws Exception {
     this.conf = config;
 
-    String znodeParentPath = conf.get(
+    this.znodeParentPath = conf.get(
         YarnConfiguration.RM_SCHEDCONF_STORE_ZK_PARENT_PATH,
         YarnConfiguration.DEFAULT_RM_SCHEDCONF_STORE_ZK_PARENT_PATH);
 
@@ -144,7 +145,7 @@ public class ZKConfigurationStore extends YarnConfigurationStore {
 
   @Override
   public void format() throws Exception {
-    zkManager.delete(confStorePath);
+    zkManager.delete(znodeParentPath);
   }
 
   @Override