code: void verifyDistributedUpgradeProgress(StartupOption startOpt
                                          ) throws IOException {
      if(startOpt == StartupOption.ROLLBACK || startOpt == StartupOption.IMPORT)
        return;
  
      assert upgradeManager != null : "FSNameSystem.upgradeManager is null.";
      if(startOpt != StartupOption.UPGRADE) {
        if(upgradeManager.getUpgradeState())
          throw new IOException(
                      "\n   Previous distributed upgrade was not completed. "
                    + "\n   Please restart NameNode with -upgrade option.");
        if(upgradeManager.getDistributedUpgrades() != null)
          throw new IOException("\n   Distributed upgrade for NameNode version "
                                + upgradeManager.getUpgradeVersion()
                                + " to current LV " + layoutVersion
                                + " is required.\n   Please restart NameNode"
                                + " with -upgrade option.");
      }
    }
docs: Verify that the distributed upgrade state is valid.
  @param startOpt the option the namenode was started with.