peterxcli commented on code in PR #8157:
URL: https://github.com/apache/ozone/pull/8157#discussion_r2012748531
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java:
##########
@@ -165,6 +165,14 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager, Execut
throw new OMException("Snapshot already exists", FILE_ALREADY_EXISTS);
}
+ // Check snapshot limit
+ int maxSnapshots = ozoneManager.getFsSnapshotMaxLimit();
+ if (omMetrics.getNumSnapshotActive() >= maxSnapshots) {
Review Comment:
> 1\. We can't rely on this metric. If a bootstrapped node becomes the
leader, it may not have the correct active snapshot count. We should use
SnapshotInfoTable size.
I think it still have consistent value, which is guarantee by ratis.
> 2\. Should we compare it against total snapshots? I'm thinking that if
there is an issue in the SnapshotDeletionService, we may accumulate a lot of
snapshots without knowing that there is a problem in the snapshot purge unless
someone has good dashboard and alarms in place.
Maybe use the size of globalSnapshotChain map in SnapshotChainManager?
--
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]