HDDS-14429. Avoid Duplicate Transaction Deletion and Replica-Level TxnSize Updates #9645
+2
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR improves how deleted block transactions are handled in the SCM. It avoids doing the same work multiple times during transaction processing and removal. Transaction size is now updated only once for each successfully processed transaction, and duplicate delete operations are removed. This makes the process more efficient and accurate.
This change is added only to improve the capacity distribution metrics and not related to deletion functionality.
Transaction Size Map Update Logic: The logic for updating the transaction size map (addTxToTxSizeMap) has been refined to ensure it is only invoked for transactions that are successfully added and not for duplicates. This prevents incorrect updates for transactions that are already being processed.
Streamlined Transaction Removal: The process for removing deleted block transactions has been streamlined by consolidating the removal calls and delegating the responsibility to transactionStatusManager. This change eliminates redundant calls to remove transactions from different state managers, ensuring a single, authoritative removal mechanism.
What is the link to the Apache JIRA
HDDS-14429
How was this patch tested?
There is not logic changes, so that it can be validated by existing unit and integration tests.