Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ public OmSnapshotManager(OzoneManager ozoneManager) {
OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES,
OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES_DEFAULT
);
if (this.maxOpenSstFilesInSnapshotDb <= 0) {
throw new IllegalArgumentException(
OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES + " must be positive.");
}

Comment thread
jojochuang marked this conversation as resolved.
Outdated
ColumnFamilyHandle snapDiffJobCf;
ColumnFamilyHandle snapDiffReportCf;
ColumnFamilyHandle snapDiffPurgedJobCf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,4 +749,14 @@ private SnapshotInfo createSnapshotInfo(String volumeName,
UUID.randomUUID(),
Time.now());
}

@Test
void testNegativeMaxOpenFiles(@TempDir File tempDir) throws Exception {
Comment thread
jojochuang marked this conversation as resolved.
OzoneConfiguration conf = new OzoneConfiguration();
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, tempDir.getAbsolutePath());
conf.setInt(OMConfigKeys.OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES, -2);
conf.setBoolean(OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY, true);

assertThrows(IllegalArgumentException.class, () -> new OmTestManagers(conf));
}
}
Loading