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 06:31:48 UTC

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

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