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/01/30 23:44:38 UTC

[GitHub] [hadoop-ozone] hanishakoneru opened a new pull request #512: HDDS-2959. Handle replay of OM Key ACL requests

hanishakoneru opened a new pull request #512: HDDS-2959. Handle replay of OM Key ACL requests
URL: https://github.com/apache/hadoop-ozone/pull/512
 
 
   ## What changes were proposed in this pull request?
   
   To ensure that Key acl operations are idempotent, compare the transactionID with the objectID and updateID to make sure that the transaction is not a replay. If the transactionID <= updateID, then it implies that the transaction is a replay and hence it should be skipped.
   
   OMKeyAclRequests (Add, Remove and Set ACL requests) are made idempotent in this Jira.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-2959
   
   ## How was this patch tested?
   
   Unit tests are added
   

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


[GitHub] [hadoop-ozone] hanishakoneru commented on issue #512: HDDS-2959. Handle replay of OM Key ACL requests

Posted by GitBox <gi...@apache.org>.
hanishakoneru commented on issue #512: HDDS-2959. Handle replay of OM Key ACL requests
URL: https://github.com/apache/hadoop-ozone/pull/512#issuecomment-584402525
 
 
   Thank you @bharatviswa504 and @arp7 for the reviews. 
   CI run is green. I will merge this PR.

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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [hadoop-ozone] hanishakoneru merged pull request #512: HDDS-2959. Handle replay of OM Key ACL requests

Posted by GitBox <gi...@apache.org>.
hanishakoneru merged pull request #512: HDDS-2959. Handle replay of OM Key ACL requests
URL: https://github.com/apache/hadoop-ozone/pull/512
 
 
   

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


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

Posted by GitBox <gi...@apache.org>.
arp7 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_r374275111
 
 

 ##########
 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:
   Was this check moved somewhere else?

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