swamirishi commented on code in PR #8157:
URL: https://github.com/apache/ozone/pull/8157#discussion_r2071916413


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -859,6 +869,42 @@ private void validateSnapshotsExistAndActive(final String 
volumeName,
     checkSnapshotActive(toSnapInfo, false);
   }
 
+  public void snapshotLimitCheck() throws IOException, OMException {
+    OmMetadataManagerImpl omMetadataManager = (OmMetadataManagerImpl) 
ozoneManager.getMetadataManager();
+    SnapshotChainManager snapshotChainManager = 
omMetadataManager.getSnapshotChainManager();
+    int currentSnapshotNum = 
snapshotChainManager.getGlobalSnapshotChain().size();

Review Comment:
   Can't we call this inside inflightSnapshotCount.updateAndGet() function that 
would make this threadsafe and consistent.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java:
##########
@@ -859,6 +869,42 @@ private void validateSnapshotsExistAndActive(final String 
volumeName,
     checkSnapshotActive(toSnapInfo, false);
   }
 
+  public void snapshotLimitCheck() throws IOException, OMException {
+    OmMetadataManagerImpl omMetadataManager = (OmMetadataManagerImpl) 
ozoneManager.getMetadataManager();
+    SnapshotChainManager snapshotChainManager = 
omMetadataManager.getSnapshotChainManager();
+    int currentSnapshotNum = 
snapshotChainManager.getGlobalSnapshotChain().size();

Review Comment:
   @peterxcli Can't we call this inside inflightSnapshotCount.updateAndGet() 
function that would make this threadsafe and consistent.



-- 
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]

Reply via email to