HDFS-10769. BlockIdManager.clear doesn't reset the counter for blockGroupIdGenerator (Contributed by Yiqun Lin and Rakesh R)
This commit is contained in:
parent
7b4e9ec3b0
commit
77f2684dd3
|
@ -225,6 +225,7 @@ public class BlockIdManager {
|
|||
generationStamp.setCurrentValue(GenerationStamp.LAST_RESERVED_STAMP);
|
||||
getBlockIdGenerator().setCurrentValue(SequentialBlockIdGenerator
|
||||
.LAST_RESERVED_BLOCK_ID);
|
||||
getBlockGroupIdGenerator().setCurrentValue(Long.MIN_VALUE);
|
||||
legacyGenerationStampLimit = HdfsConstants.GRANDFATHER_GENERATION_STAMP;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,6 +124,11 @@ public class TestSequentialBlockGroupId {
|
|||
assertThat("BlockGrpId mismatches!", nextBlockGrpId,
|
||||
is(nextBlockExpectedId));
|
||||
}
|
||||
|
||||
// verify that the blockGroupId resets on #clear call.
|
||||
cluster.getNamesystem().getBlockManager().clear();
|
||||
assertThat("BlockGrpId mismatches!", blockGrpIdGenerator.getCurrentValue(),
|
||||
is(Long.MIN_VALUE));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue