diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/HddsUpgradeTestUtils.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/HddsUpgradeTestUtils.java index 7fcc4cd53a58..31752abee562 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/HddsUpgradeTestUtils.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/HddsUpgradeTestUtils.java @@ -133,16 +133,20 @@ private static boolean isScmFinalized(StorageContainerManager scm, boolean waitF try { dbKeyFlushed = scm.getScmMetadataStore().getMetaTable().get(OzoneConsts.APPARENT_VERSION_KEY) != null; } catch (RocksDatabaseException | CodecException e) { - throw new RuntimeException(e); + // The metadata RocksDB is briefly closed while a Ratis snapshot install reloads the checkpoint. + // Treat that as "not finalized yet" and let waitFor retry rather than failing the test. + LOG.info("SCM {} metadata DB not readable yet (snapshot install in progress?), will retry.", + scm.getSCMNodeId(), e); } LOG.info("Waiting for SCM {} (leader? {}) to finalize.\n" + - "Exited safemode? {}\n" + + "Exited safemode? (not required) {}\n" + "version manager finalized? {}\n" + "DB key flushed? {}\n" + "Requiring DB key to flush? {}", scm.getSCMNodeId(), scm.checkLeader(), exitedSafemode, isFinalized, dbKeyFlushed, waitForDBKeyFlush); - return exitedSafemode && isFinalized && (!waitForDBKeyFlush || dbKeyFlushed); + // Safemode exit status is included for logging purposes, but SCMs can still finalize while in safemode. + return isFinalized && (!waitForDBKeyFlush || dbKeyFlushed); } }