Xushaohong commented on a change in pull request #3121:
URL: https://github.com/apache/ozone/pull/3121#discussion_r812782601



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/OMClientResponse.java
##########
@@ -85,8 +85,15 @@ public void checkStatusNotOK() {
    */
   public void checkAndUpdateDB(OMMetadataManager omMetadataManager,
       BatchOperation batchOperation) throws IOException {
-    if (omResponse.getStatus() == OzoneManagerProtocolProtos.Status.OK) {
+    switch (omResponse.getStatus()) {
+    case PARTIAL_DELETE:
+    case PARTIAL_RENAME:
+    case OK:
       addToDBBatch(omMetadataManager, batchOperation);
+      break;
+    default:
+      // do nothing
+      break;

Review comment:
       > Thanks for catching this. I think:
   > 
   > 1. It should be done in a separate Jira/PR, as it's a different bug.
   > 2. It would be nice to add a test case for the bug this is fixing.
   > 3. Keep it consistent with `OMKeysDeleteResponse`, which already handles 
`PARTIAL_DELETE`:
   >    
https://github.com/apache/ozone/blob/68c5ac5df4fbc0edd7114394112fa696a3dc9229/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeysDeleteResponse.java#L63-L70
   >    
   >    By keeping it consistent I mean: either remove that overridden method 
and handle it in `OMClientResponse`, or override in `OMKeysRenameResponse`, 
too.  I slightly prefer this latter solution.
   
   got it.




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