HDDS-14572. ReInit DeletedBlocksTransactionSummary after SCM leader transfer#9720
HDDS-14572. ReInit DeletedBlocksTransactionSummary after SCM leader transfer#9720ChenSammi merged 3 commits intoapache:masterfrom
Conversation
priyeshkaratha
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi for the patch. Changes LGTM. Minor comments on logging.
| LOG.warn("Failed to initialize Storage space distribution data. The feature will continue with current " + | ||
| "totalBlockCount {}, totalBlockCount {}, totalBlocksSize {} and totalReplicatedBlocksSize {}. " + | ||
| "There is a high chance that the real data and current data has a fixed gap.", | ||
| totalBlockCount.get(), totalBlocksSize.get(), totalBlocksSize.get(), totalReplicatedBlocksSize.get()); |
There was a problem hiding this comment.
| LOG.warn("Failed to initialize Storage space distribution data. The feature will continue with current " + | |
| "totalBlockCount {}, totalBlockCount {}, totalBlocksSize {} and totalReplicatedBlocksSize {}. " + | |
| "There is a high chance that the real data and current data has a fixed gap.", | |
| totalBlockCount.get(), totalBlocksSize.get(), totalBlocksSize.get(), totalReplicatedBlocksSize.get()); | |
| LOG.warn("Failed to initialize Storage space distribution data. The feature will continue with current " + | |
| "totalBlockCount {}, totalTxCount {}, totalBlocksSize {} and totalReplicatedBlocksSize {}. " + | |
| "There is a high chance that the real data and current data has a fixed gap.", | |
| totalBlockCount.get(), totalTxCount.get(), totalBlocksSize.get(), totalReplicatedBlocksSize.get()); |
There was a problem hiding this comment.
nit - totalBlocksSize used twice instead of totalTxCount
priyeshkaratha
left a comment
There was a problem hiding this comment.
Thanks @ChenSammi for updating the patch. LGTM
ashishkumar50
left a comment
There was a problem hiding this comment.
@ChenSammi Thanks for the patch, LGTM except a minor suggestion.
| transactionToDNsCommitMap.clear(); | ||
| txSizeMap.clear(); | ||
| try { | ||
| initDataDistributionData(); |
There was a problem hiding this comment.
We can move this code to other method and call when there is leadertransfer instead using inside clear which is logically meant for clearing all the memory maps or alternatively just update the method name.
There was a problem hiding this comment.
Agree. Rename clear() to onBecomeLeader()
ashishkumar50
left a comment
There was a problem hiding this comment.
Thanks for updating patch, LGTM.
|
Thanks @priyeshkaratha and @ashishkumar50 for the review. |
What changes were proposed in this pull request?
ReInit DeletedBlocksTransactionSummary after SCM leader transfer.
Currently DeletedBlocksTransactionSummary is not reinited after SCM leader transfer. This is the reason of negative DeletedBlocksTransactionSummary value after leader transfer.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14572
How was this patch tested?
new unit tests