You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/02/03 18:51:29 UTC

[GitHub] [hadoop-ozone] hanishakoneru commented on a change in pull request #512: HDDS-2959. Handle replay of OM Key ACL requests

hanishakoneru commented on a change in pull request #512: HDDS-2959. Handle replay of OM Key ACL requests
URL: https://github.com/apache/hadoop-ozone/pull/512#discussion_r374276681
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/acl/OMKeyAclResponse.java
 ##########
 @@ -36,27 +34,30 @@
  */
 public class OMKeyAclResponse extends OMClientResponse {
 
-  private final OmKeyInfo omKeyInfo;
+  private OmKeyInfo omKeyInfo;
 
-  public OMKeyAclResponse(@Nullable OmKeyInfo omKeyInfo,
-      @Nonnull OMResponse omResponse) {
+  public OMKeyAclResponse(@Nonnull OMResponse omResponse,
+      @Nonnull OmKeyInfo omKeyInfo) {
     super(omResponse);
     this.omKeyInfo = omKeyInfo;
   }
 
+  /**
+   * For when the request is not successful or it is a replay transaction.
+   * For a successful request, the other constructor should be used.
+   */
+  public OMKeyAclResponse(@Nonnull OMResponse omResponse) {
+    super(omResponse);
+  }
+
   @Override
   public void addToDBBatch(OMMetadataManager omMetadataManager,
       BatchOperation batchOperation) throws IOException {
 
-    // If response status is OK and success is true, add to DB batch.
-    if (getOMResponse().getStatus() == OzoneManagerProtocolProtos.Status.OK &&
 
 Review comment:
   Yes Arpit. OmClientResponse#checkAndUpdateDB() performs this check before calling addToDBBatch(). OMDoubleBuffer now calls checkAndUpdateDB() instead of addToDBBatch() directly.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org