smengcl commented on code in PR #4419:
URL: https://github.com/apache/ozone/pull/4419#discussion_r1146943850
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshot.java:
##########
@@ -82,11 +91,30 @@ public OmSnapshot(KeyManager keyManager,
this.bucketName = bucketName;
this.volumeName = volumeName;
this.omMetadataManager = keyManager.getMetadataManager();
+ this.snapshotDBKey = SnapshotInfo.getTableKey(
+ volumeName, bucketName, snapshotName);
+ this.activeOMMetadataManager = ozoneManager.getMetadataManager();
}
+ /**
+ * Check snapshot status in active DB snapshotInfoTable.
+ * @throws IOException FileNotFoundException when snapshot is not active.
+ */
+ private void checkSnapshotStatus() throws IOException {
+ if (activeOMMetadataManager.getSnapshotInfoTable().get(snapshotDBKey)
Review Comment:
Right. I will do another take on this with @sadanand48 's suggestion. Block
instance creation if snapshot is not ACTIVE, and close the instance on snapshot
delete. Reference counting will be done in another jira to ensure DB instances
in active use won't be closed.
--
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]