{"record":{"id":"5d3e18df572a5dcb","repo":"apache/hadoop","slug":"it-looks-like-the-shared-log-is-already-being-upgr","errorCode":null,"errorMessage":"It looks like the shared log is already being upgraded but this NN has not been upgraded yet. You should restart this NameNode with the '-bootstrapStandby' option to bring this NN in sync with the other.","messagePattern":"It looks like the shared log is already being upgraded but this NN has not been upgraded yet\\. You should restart this NameNode with the '-bootstrapStandby' option to bring this NN in sync with the other\\.","errorType":"exception","errorClass":"java.io.IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java","lineNumber":850,"sourceCode":"    Preconditions.checkState(getNamespaceID() != 0,\n        \"Must know namespace ID before initting edit log\");\n    String nameserviceId = DFSUtil.getNamenodeNameServiceId(conf);\n    if (!HAUtil.isHAEnabled(conf, nameserviceId)) {\n      // If this NN is not HA\n      editLog.initJournalsForWrite();\n      editLog.recoverUnclosedStreams();\n    } else if (HAUtil.isHAEnabled(conf, nameserviceId)\n        && (startOpt == StartupOption.UPGRADE\n            || startOpt == StartupOption.UPGRADEONLY\n            || RollingUpgradeStartupOption.ROLLBACK.matches(startOpt))) {\n      // This NN is HA, but we're doing an upgrade or a rollback of rolling\n      // upgrade so init the edit log for write.\n      editLog.initJournalsForWrite();\n      if (startOpt == StartupOption.UPGRADE\n          || startOpt == StartupOption.UPGRADEONLY) {\n        long sharedLogCTime = editLog.getSharedLogCTime();\n        if (this.storage.getCTime() < sharedLogCTime) {\n          throw new IOException(\"It looks like the shared log is already \" +\n              \"being upgraded but this NN has not been upgraded yet. You \" +\n              \"should restart this NameNode with the '\" +\n              StartupOption.BOOTSTRAPSTANDBY.getName() + \"' option to bring \" +\n              \"this NN in sync with the other.\");\n        }\n      }\n      editLog.recoverUnclosedStreams();\n    } else {\n      // This NN is HA and we're not doing an upgrade.\n      editLog.initSharedJournalsForRead();\n    }\n  }\n\n  /**\n   * @param imageFile the image file that was loaded\n   * @param numEditsLoaded the number of edits loaded from edits logs\n   * @return true if the NameNode should automatically save the namespace\n   * when it is started, due to the latest checkpoint being too old.","sourceCodeStart":832,"sourceCodeEnd":868,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java#L832-L868","documentation":"Error \"It looks like the shared log is already being upgraded but this NN has not been upgraded yet. You should restart this NameNode with the '-bootstrapStandby' option to bring this NN in sync with the other.\" thrown in apache/hadoop.","triggerScenarios":"Starting a standby NameNode whose shared edits directory was already upgraded by the active NN while this NN still runs the older software.","commonSituations":"See trigger scenarios.","solutions":["Restart this NameNode with the '-bootstrapStandby' option to sync its storage with the upgraded active NameNode."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}