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/06/24 05:40:28 UTC

[GitHub] [ozone] lokeshj1703 opened a new pull request #2361: HDDS-5289. Update container's deleteTransactionId on creation of the transaction in SCM.

lokeshj1703 opened a new pull request #2361:
URL: https://github.com/apache/ozone/pull/2361


   ## What changes were proposed in this pull request?
   
   Container's delete transactionId is updated today when block deleting service processes the transaction. This makes sure that container's transactionId is in sync with replicas. 
   With HA updating transactionId could lead to several ratis log entries. The PR makes a change where txnId for container is updated when transaction is created in SCM rather than when it is processed.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5289
   
   ## How was this patch tested?
   
   Existing 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] bshashikant commented on a change in pull request #2361: HDDS-5289. Update container's deleteTransactionId on creation of the transaction in SCM.

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



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -167,8 +172,13 @@ public void removeFromDB() throws IOException {
   @Override
   public void addTransactionsToDB(ArrayList<DeletedBlocksTransaction> txs)
       throws IOException {
+    Map<ContainerID, Long> containerIdToTxnIdMap = new HashMap<>();
     for (DeletedBlocksTransaction tx : txs) {
+      long tid = tx.getTxID();
+      containerIdToTxnIdMap.compute(ContainerID.valueOf(tx.getContainerID()),
+          (k, v) -> v != null && v > tid ? v : tid);
       transactionBuffer.addToBuffer(deletedTable, tx.getTxID(), tx);

Review comment:
       transactionBuffer.addToBuffer will update the DB only when the ratis snapshot is taken, where as the next call  , containerManager.updateDeleteTransactionId will update the in-memory state as well the container db right away. Is this desirable?




-- 
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] bshashikant merged pull request #2361: HDDS-5289. Update container's deleteTransactionId on creation of the transaction in SCM.

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


   


-- 
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] lokeshj1703 commented on a change in pull request #2361: HDDS-5289. Update container's deleteTransactionId on creation of the transaction in SCM.

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



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogStateManagerImpl.java
##########
@@ -167,8 +172,13 @@ public void removeFromDB() throws IOException {
   @Override
   public void addTransactionsToDB(ArrayList<DeletedBlocksTransaction> txs)
       throws IOException {
+    Map<ContainerID, Long> containerIdToTxnIdMap = new HashMap<>();
     for (DeletedBlocksTransaction tx : txs) {
+      long tid = tx.getTxID();
+      containerIdToTxnIdMap.compute(ContainerID.valueOf(tx.getContainerID()),
+          (k, v) -> v != null && v > tid ? v : tid);
       transactionBuffer.addToBuffer(deletedTable, tx.getTxID(), tx);

Review comment:
       Fixed in latest commit. containerManager.updateDeleteTransactionId  now updates DB via transactionBuffer.




-- 
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] bshashikant commented on pull request #2361: HDDS-5289. Update container's deleteTransactionId on creation of the transaction in SCM.

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


   Thanks @lokeshj1703 for the fix.


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