Skip to content

HDDS-14572. ReInit DeletedBlocksTransactionSummary after SCM leader transfer#9720

Merged
ChenSammi merged 3 commits intoapache:masterfrom
ChenSammi:HDDS-14572
Feb 9, 2026
Merged

HDDS-14572. ReInit DeletedBlocksTransactionSummary after SCM leader transfer#9720
ChenSammi merged 3 commits intoapache:masterfrom
ChenSammi:HDDS-14572

Conversation

@ChenSammi
Copy link
Contributor

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

Copy link
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ChenSammi for the patch. Changes LGTM. Minor comments on logging.

Comment on lines 430 to 433
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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - totalBlocksSize used twice instead of totalTxCount

Copy link
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ChenSammi for updating the patch. LGTM

Copy link
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenSammi Thanks for the patch, LGTM except a minor suggestion.

transactionToDNsCommitMap.clear();
txSizeMap.clear();
try {
initDataDistributionData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Rename clear() to onBecomeLeader()

Copy link
Contributor

@ashishkumar50 ashishkumar50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating patch, LGTM.

@ChenSammi ChenSammi merged commit 1d0c9ba into apache:master Feb 9, 2026
44 checks passed
@ChenSammi
Copy link
Contributor Author

Thanks @priyeshkaratha and @ashishkumar50 for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants