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 2021/02/09 08:37:17 UTC

[GitHub] [ozone] amaliujia opened a new pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

amaliujia opened a new pull request #1914:
URL: https://github.com/apache/ozone/pull/1914


   ## What changes were proposed in this pull request?
   
   Only trigger a Ratis oncall when in-memory retry count exceed max_retry.
   
   ## What is the link to the Apache JIRA
   
   
   
   ## How was this patch tested?
   
   UT
   


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



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


[GitHub] [ozone] runzhiwang commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-787695414


   @amaliujia Thanks the patch. @GlenGeng Thanks for review. I have merged 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [ozone] amaliujia edited a comment on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-775767212


   R: @GlenGeng @bshashikant 
   
   Based on what we have discussed offline, I created this PR for retry count improvement.


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



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


[GitHub] [ozone] GlenGeng commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-783140452


   Thanks @amaliujia  for the work. Overall, LGTM.
   
   Could you please add a `failingTxIDs` into `DeletedBlockLogStateManagerImpl`, just like `deletingTxIDs`, so that we can also filter the on-going count setting in `DeletedBlockLogStateManagerImpl#findNext` ?


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



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


[GitHub] [ozone] amaliujia commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-775767212


   R: @GlenGeng 


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



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


[GitHub] [ozone] amaliujia edited a comment on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-775767212


   R: @GlenGeng @bshashikant 
   
   Based on what we have discussed offline, I created this PR for increment count improvement.


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



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


[GitHub] [ozone] amaliujia commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-785684195


   @GlenGeng  
   
   I will try to address your comment in the weekend.


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



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


[GitHub] [ozone] GlenGeng commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-787694350


   @runzhiwang  Please help merge it. Thanks!


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



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


[GitHub] [ozone] GlenGeng commented on a change in pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on a change in pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#discussion_r584425057



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -187,19 +190,13 @@ public void increaseRetryCountOfTransactionInDB(
         }
         continue;
       }
-      DeletedBlocksTransaction.Builder builder = block.toBuilder();
-      int currentCount = block.getCount();
-      if (currentCount > -1) {
-        builder.setCount(++currentCount);
-      }
       // if the retry time exceeds the maxRetry value
       // then set the retry value to -1, stop retrying, admins can
       // analyze those blocks and purge them manually by SCMCli.
-      if (currentCount > maxRetry) {
-        builder.setCount(-1);
-      }
+      DeletedBlocksTransaction.Builder builder = block.toBuilder().setCount(-1);
       deletedTable.putWithBatch(
           transactionBuffer.getCurrentBatchOperation(), txID, builder.build());
+      skippingRetryTxIDs.add(txID);

Review comment:
       You need clear `skippingRetryTxIDs` in `onFlush` too. 




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



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


[GitHub] [ozone] GlenGeng commented on a change in pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on a change in pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#discussion_r584425193



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImplV2.java
##########
@@ -79,6 +79,8 @@
   private final Lock lock;
   // Maps txId to set of DNs which are successful in committing the transaction
   private Map<Long, Set<UUID>> transactionToDNsCommitMap;
+  // Maps txId to its retry counts;
+  private Map<Long, Integer> transactionRetryCountMap;

Review comment:
       `transactionRetryCountMap` to `transactionToRetryCountMap `

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImplV2.java
##########
@@ -145,8 +148,25 @@ public DeletedBlockLogImplV2(ConfigurationSource conf,
   public void incrementCount(List<Long> txIDs) throws IOException {
     lock.lock();
     try {
-      deletedBlockLogStateManager
-          .increaseRetryCountOfTransactionInDB(new ArrayList<>(txIDs));
+      ArrayList<Long> toUpdateTxIDs = new ArrayList<>();
+      for (Long txID : txIDs) {
+        int currentCount =
+            transactionRetryCountMap.getOrDefault(txID, 0);
+        if (currentCount > maxRetry) {
+          continue;
+        } else {
+          currentCount += 1;
+          if (currentCount > maxRetry) {
+            toUpdateTxIDs.add(txID);
+          }
+          transactionRetryCountMap.put(txID, currentCount);
+        }
+      }
+
+      if (!toUpdateTxIDs.isEmpty()) {

Review comment:
       `toUpdateTxIDs` -> `txIDsToUpdate`




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



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


[GitHub] [ozone] amaliujia commented on a change in pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#discussion_r584440544



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImplV2.java
##########
@@ -145,8 +148,25 @@ public DeletedBlockLogImplV2(ConfigurationSource conf,
   public void incrementCount(List<Long> txIDs) throws IOException {
     lock.lock();
     try {
-      deletedBlockLogStateManager
-          .increaseRetryCountOfTransactionInDB(new ArrayList<>(txIDs));
+      ArrayList<Long> toUpdateTxIDs = new ArrayList<>();
+      for (Long txID : txIDs) {
+        int currentCount =
+            transactionRetryCountMap.getOrDefault(txID, 0);
+        if (currentCount > maxRetry) {
+          continue;
+        } else {
+          currentCount += 1;
+          if (currentCount > maxRetry) {
+            toUpdateTxIDs.add(txID);
+          }
+          transactionRetryCountMap.put(txID, currentCount);
+        }
+      }
+
+      if (!toUpdateTxIDs.isEmpty()) {

Review comment:
       Done

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImplV2.java
##########
@@ -79,6 +79,8 @@
   private final Lock lock;
   // Maps txId to set of DNs which are successful in committing the transaction
   private Map<Long, Set<UUID>> transactionToDNsCommitMap;
+  // Maps txId to its retry counts;
+  private Map<Long, Integer> transactionRetryCountMap;

Review comment:
       Done

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -187,19 +190,13 @@ public void increaseRetryCountOfTransactionInDB(
         }
         continue;
       }
-      DeletedBlocksTransaction.Builder builder = block.toBuilder();
-      int currentCount = block.getCount();
-      if (currentCount > -1) {
-        builder.setCount(++currentCount);
-      }
       // if the retry time exceeds the maxRetry value
       // then set the retry value to -1, stop retrying, admins can
       // analyze those blocks and purge them manually by SCMCli.
-      if (currentCount > maxRetry) {
-        builder.setCount(-1);
-      }
+      DeletedBlocksTransaction.Builder builder = block.toBuilder().setCount(-1);
       deletedTable.putWithBatch(
           transactionBuffer.getCurrentBatchOperation(), txID, builder.build());
+      skippingRetryTxIDs.add(txID);

Review comment:
       Gotcha. thanks!




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



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


[GitHub] [ozone] runzhiwang merged pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
runzhiwang merged pull request #1914:
URL: https://github.com/apache/ozone/pull/1914


   


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



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


[GitHub] [ozone] amaliujia commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-787603570


   @GlenGeng  PR updated. Can you take another look?


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



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


[GitHub] [ozone] amaliujia commented on a change in pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#discussion_r572687979



##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java
##########
@@ -258,47 +258,6 @@ public void testIncrementCount() throws Exception {
     Assert.assertEquals(blocks.size(), 0);
   }
 
-  @Test
-  public void testIncrementCountLessFrequentWritingToDB() throws Exception {

Review comment:
       existing `testIncrementCount()` has tested the expected behavior.




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



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


[GitHub] [ozone] GlenGeng commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-785680002


   Could you please rebase the PR ? Do you need help...


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



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


[GitHub] [ozone] amaliujia commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-783081321


   @GlenGeng friendly ping on 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



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


[GitHub] [ozone] GlenGeng commented on pull request #1914: HDDS-4761. Implement increment count optimization in DeletedBlockLog V2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1914:
URL: https://github.com/apache/ozone/pull/1914#issuecomment-787669861


   +1. Thanks @amaliujia for the contribution!


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



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