smengcl commented on code in PR #4333:
URL: https://github.com/apache/ozone/pull/4333#discussion_r1122562145
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotCreateResponse.java:
##########
@@ -68,5 +73,16 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
// Add to db
omMetadataManager.getSnapshotInfoTable().putWithBatch(batchOperation,
key, snapshotInfo);
+
+ // Remove all entries from renamedKeyTable
+ TableIterator<Long, ? extends Table.KeyValue<Long, RepeatedOmString>>
+ iterator = omMetadataManager.getRenamedKeyTable().iterator();
+
+ while (iterator.hasNext()) {
+ Long objectID = iterator.next().getKey();
+ omMetadataManager.getRenamedKeyTable()
+ .deleteWithBatch(batchOperation, objectID);
+ }
Review Comment:
This should be done inside `createOmSnapshotCheckpoint` with lock held like
in #4280 . For this PR you can put a TODO here since the other PR is not merged
yet (which has the locking and deleteRange implementation).
And it should only remove entries in the snapshot scope in
`renamedKeyTable`, similar to `deletedTable`.
--
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]