HDFS-15201 SnapshotCounter hits MaxSnapshotID limit (#1870)
This commit is contained in:
parent
5eddc82fb8
commit
5250cd6db3
@ -96,7 +96,7 @@ public class SnapshotManager implements SnapshotStatsMXBean {
|
||||
private final boolean snapshotDiffAllowSnapRootDescendant;
|
||||
|
||||
private final AtomicInteger numSnapshots = new AtomicInteger();
|
||||
private static final int SNAPSHOT_ID_BIT_WIDTH = 24;
|
||||
private static final int SNAPSHOT_ID_BIT_WIDTH = 28;
|
||||
|
||||
private boolean allowNestedSnapshots = false;
|
||||
private int snapshotCounter = 0;
|
||||
|
@ -92,4 +92,18 @@ public void testSnapshotLimits() throws Exception {
|
||||
StringUtils.toLowerCase(se.getMessage()).contains("rollover"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Snapshot is identified by INODE CURRENT_STATE_ID.
|
||||
* So maximum allowable snapshotID should be less than CURRENT_STATE_ID
|
||||
*/
|
||||
@Test
|
||||
public void testValidateSnapshotIDWidth() {
|
||||
FSDirectory fsdir = mock(FSDirectory.class);
|
||||
SnapshotManager snapshotManager = new SnapshotManager(new Configuration(),
|
||||
fsdir);
|
||||
Assert.assertTrue(snapshotManager.
|
||||
getMaxSnapshotID() < Snapshot.CURRENT_STATE_ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user