{"record":{"id":"ae300227d41bd8cc","repo":"apache/hadoop","slug":"multiple-shared-edits-directories-are-not-yet-supp","errorCode":null,"errorMessage":"Multiple shared edits directories are not yet supported","messagePattern":"Multiple shared edits directories are not yet supported","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":1794,"sourceCode":"   */\n  public static List<URI> getNamespaceEditsDirs(Configuration conf)\n      throws IOException {\n    return getNamespaceEditsDirs(conf, true);\n  }\n  \n  public static List<URI> getNamespaceEditsDirs(Configuration conf,\n      boolean includeShared)\n      throws IOException {\n    // Use a LinkedHashSet so that order is maintained while we de-dup\n    // the entries.\n    LinkedHashSet<URI> editsDirs = new LinkedHashSet<URI>();\n    \n    if (includeShared) {\n      List<URI> sharedDirs = getSharedEditsDirs(conf);\n  \n      // Fail until multiple shared edits directories are supported (HDFS-2782)\n      if (sharedDirs.size() > 1) {\n        throw new IOException(\n            \"Multiple shared edits directories are not yet supported\");\n      }\n  \n      // First add the shared edits dirs. It's critical that the shared dirs\n      // are added first, since JournalSet syncs them in the order they are listed,\n      // and we need to make sure all edits are in place in the shared storage\n      // before they are replicated locally. See HDFS-2874.\n      for (URI dir : sharedDirs) {\n        if (!editsDirs.add(dir)) {\n          LOG.warn(\"Edits URI \" + dir + \" listed multiple times in \" + \n              DFS_NAMENODE_SHARED_EDITS_DIR_KEY + \". Ignoring duplicates.\");\n        }\n      }\n    }    \n    // Now add the non-shared dirs.\n    for (URI dir : getStorageDirs(conf, DFS_NAMENODE_EDITS_DIR_KEY)) {\n      if (!editsDirs.add(dir)) {\n        LOG.warn(\"Edits URI \" + dir + \" listed multiple times in \" + ","sourceCodeStart":1776,"sourceCodeEnd":1812,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L1776-L1812","documentation":"Thrown by FSNamesystem.getNamespaceEditsDirs during NameNode startup (and HA bootstrap/initializeSharedEdits) when dfs.namenode.shared.edits.dir lists more than one shared edits URI. HDFS syncs edits through a JournalSet and currently supports exactly one shared (QJM) edits directory per namespace (HDFS-2782), so requesting two is rejected outright rather than silently mis-replicating edit logs.","triggerScenarios":"Setting dfs.namenode.shared.edits.dir to a comma-separated list with 2+ URIs (e.g. two qjournal:// quorums) and then starting the NameNode, or running `hdfs namenode -bootstrapStandby` / `-initializeSharedEdits`, all of which call getNamespaceEditsDirs(conf, includeShared=true).","commonSituations":"Admin tries to mirror edit logs to a second QJM cluster for extra redundancy; a hdfs-site.xml migration leaves the old shared dir appended after the new URI instead of replaced; copy-paste of an example config with multiple entries.","solutions":["Keep exactly one URI in dfs.namenode.shared.edits.dir (after de-dup, size must be <= 1) and restart the NameNode","Add redundancy inside that single URI by listing more JournalNodes in the quorum: qjournal://jn1:8485;jn2:8485;jn3:8485/journalId","Track HDFS-2782 if two independent shared storages are truly required; until then back up the QJM journal separately"],"exampleFix":"<!-- hdfs-site.xml before -->\n<property><name>dfs.namenode.shared.edits.dir</name><value>qjournal://jn1:8485;jn2:8485;jn3:8485/ns1,qjournal://jn4:8485;jn5:8485/ns2</value></property>\n<!-- after: one shared dir, redundancy via more JournalNodes in the quorum -->\n<property><name>dfs.namenode.shared.edits.dir</name><value>qjournal://jn1:8485;jn2:8485;jn3:8485;jn4:8485/ns1</value></property>","handlingStrategy":"validation","validationCode":"import org.apache.hadoop.hdfs.DFSConfigKeys;\nList<String> shared = conf.getTrimmedCollection(DFSConfigKeys.DFS_NAMENODE_SHARED_EDITS_DIR_KEY);\nif (new HashSet<>(shared).size() > 1) {\n  throw new IOException(\"Multiple shared edits dirs not supported: \" + shared);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint hdfs-site.xml in deployment CI: fail when dfs.namenode.shared.edits.dir has 2+ URIs","Scale JournalNode count inside one qjournal:// URI; never append a second URI"],"tags":["hdfs","namenode","ha","qjm","edit-log","configuration"],"backgroundTag":"edit-log-misconfiguration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}