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 @@ void clear() {
|
||||
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 void testBlockGroupIdGeneration() throws IOException {
|
||||
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
Block a user