smengcl commented on code in PR #9810:
URL: https://github.com/apache/ozone/pull/9810#discussion_r2844521813


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotCreateResponse.java:
##########
@@ -75,5 +76,9 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
     // Create the snapshot checkpoint. Also cleans up some tables.
     OmSnapshotManager.createOmSnapshotCheckpoint(omMetadataManager,
         snapshotInfo, batchOperation);
+
+    // Add entries to snapshotIdToTableKey in case of Raft replay
+    ((OmMetadataManagerImpl) omMetadataManager).getSnapshotChainManager()
+        .addSnapshotToTableKey(snapshotInfo.getSnapshotId(), 
snapshotInfo.getTableKey());

Review Comment:
   Good catch
   
   however, I realized `validateAndUpdateCache` _is_ called during Raft replay 
(only preExecute isn't):
   
   
https://github.com/apache/ozone/blob/9a164854f993b79c5e2bea9839692fac52e7b9f2/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java#L415
   
   
https://github.com/apache/ozone/blob/e71dcf6eb425182b12f3b150e46f64d6b2e6740d/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java#L418
   
   So we don't actually need to patch addToDBBatch at all then. But this also 
means the reason tableKey becomes null in this case becomes unknown at this 
point. I'll try to add more debug logging then try to repro that downstream.



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