hemantk-12 commented on code in PR #8157:
URL: https://github.com/apache/ozone/pull/8157#discussion_r2019107488
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -988,6 +989,9 @@ private void instantiateServices(boolean withNewSnapshot)
throws IOException {
fsSnapshotEnabled = configuration.getBoolean(
OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY,
OMConfigKeys.OZONE_FILESYSTEM_SNAPSHOT_ENABLED_DEFAULT);
+ fsSnapshotMaxLimit = configuration.getInt(
Review Comment:
1. Should this config be moved to
[OmSnapshotManager](https://github.com/apache/ozone/blob/dc4789772168efe312f7832b6bb3bc3e7bc40d1b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java#L109)?
If agree, we can just move `validateSnapshotLimit` to `OmSnapshotManager` as
well.
1. Please remove this config from
[OmMetadataManagerImpl](https://github.com/apache/ozone/blob/86d2027e328cd66c3319b355f3438842440ffa70/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java#L592)
and
[DBStoreBuilder](https://github.com/apache/ozone/blob/eb96ff489209ad9dab10a3cded277ae5ccd7cb4a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStoreBuilder.java#L101).
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java:
##########
@@ -99,11 +99,23 @@ public OMSnapshotCreateRequest(OMRequest omRequest) {
snapshotPath = snapshotInfo.getSnapshotPath();
}
+ private void validateSnapshotLimit(OzoneManager ozoneManager) throws
IOException {
+ int maxSnapshots = ozoneManager.getFsSnapshotMaxLimit();
+ OMMetrics omMetrics = ozoneManager.getMetrics();
+ if (omMetrics.getNumSnapshotActive() >= maxSnapshots) {
Review Comment:
I would prefer SnapshotChain over metric. Please use SnapshotChain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]