From ac5da11399525dd31c49700a0bbf01cd37e347d5 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Mon, 15 Feb 2016 14:00:09 +0900 Subject: [PATCH] HDFS-9691. TestBlockManagerSafeMode#testCheckSafeMode fails intermittently. Contributed by Mingliang Liu. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../server/blockmanagement/TestBlockManagerSafeMode.java | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index eeff967e96..eb2b21e651 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1015,6 +1015,9 @@ Release 2.9.0 - UNRELEASED HDFS-9621. getListing wrongly associates Erasure Coding policy to pre-existing replicated files under an EC directory. (jing9) + HDFS-9691. TestBlockManagerSafeMode#testCheckSafeMode fails intermittently. + (Mingliang Liu via aajisaka) + Release 2.8.0 - UNRELEASED NEW FEATURES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManagerSafeMode.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManagerSafeMode.java index ade55748fb..d9da2c159f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManagerSafeMode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManagerSafeMode.java @@ -137,30 +137,30 @@ public void testCheckSafeMode() { } // PENDING_THRESHOLD -> EXTENSION + Whitebox.setInternalState(bmSafeMode, "extension", Integer.MAX_VALUE); setSafeModeStatus(BMSafeModeStatus.PENDING_THRESHOLD); setBlockSafe(BLOCK_THRESHOLD); bmSafeMode.checkSafeMode(); assertEquals(BMSafeModeStatus.EXTENSION, getSafeModeStatus()); - Whitebox.setInternalState(bmSafeMode, "smmthread", null); // PENDING_THRESHOLD -> OFF + Whitebox.setInternalState(bmSafeMode, "extension", 0); setSafeModeStatus(BMSafeModeStatus.PENDING_THRESHOLD); setBlockSafe(BLOCK_THRESHOLD); - Whitebox.setInternalState(bmSafeMode, "extension", 0); bmSafeMode.checkSafeMode(); assertEquals(BMSafeModeStatus.OFF, getSafeModeStatus()); // stays in EXTENSION - setSafeModeStatus(BMSafeModeStatus.EXTENSION); setBlockSafe(0); + setSafeModeStatus(BMSafeModeStatus.EXTENSION); Whitebox.setInternalState(bmSafeMode, "extension", 0); bmSafeMode.checkSafeMode(); assertEquals(BMSafeModeStatus.EXTENSION, getSafeModeStatus()); // stays in EXTENSION: pending extension period + Whitebox.setInternalState(bmSafeMode, "extension", Integer.MAX_VALUE); setSafeModeStatus(BMSafeModeStatus.EXTENSION); setBlockSafe(BLOCK_THRESHOLD); - Whitebox.setInternalState(bmSafeMode, "extension", Integer.MAX_VALUE); bmSafeMode.checkSafeMode(); assertEquals(BMSafeModeStatus.EXTENSION, getSafeModeStatus()); }