Skip to content

Commit 906611e

Browse files
committed
document verifyInitialState
1 parent 84b7e45 commit 906611e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDecommissioningStatus.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@ public void testDecommissionStatus() throws Exception {
323323
AdminStatesBaseTest.cleanupFile(fileSys, file2);
324324
}
325325

326+
// Why do we verify initial state of DataNodes here?
327+
// Before we start actual decommission testing, we should ensure that
328+
// total 8 blocks (original 4 blocks of 2 files and 4 replicas) are
329+
// present over two Datanodes available. If we don't wait until all 8 blocks
330+
// are reported live by BlockManager, we might get to a situation
331+
// where one of the replicas might not yet been present on any of Datanodes
332+
// and we start decommissioning process, and then it would result in
333+
// flaky test because total (no of under replicated blocks, no of outOfService
334+
// only replicas, no of under replicated in open files) counts would be
335+
// incorrect.
326336
protected void verifyInitialState(FSNamesystem fsn, DatanodeManager dm)
327337
throws InterruptedException {
328338
dm.getDatanodes().forEach(datanodeDescriptor -> {

0 commit comments

Comments
 (0)