Skip to content

HDDS-15726. Improve SCM block deletion summary error handling#10650

Merged
aryangupta1998 merged 2 commits into
apache:masterfrom
ChenSammi:HDDS-15726
Jul 13, 2026
Merged

HDDS-15726. Improve SCM block deletion summary error handling#10650
aryangupta1998 merged 2 commits into
apache:masterfrom
ChenSammi:HDDS-15726

Conversation

@ChenSammi

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Improve the block deletion summary error handing

  1. check leader ready in onMessage()
  2. adjust summary if db persist fails
  3. add debug log info for summary change, for further debug purpose

What is the link to the Apache JIRA

HDDS-15726

How was this patch tested?

existing unit tests.

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @ChenSammi for working on this. Changes LGTM. Just have minor suggestion on newly added method name.

deletedBlockLogStateManager.addTransactionsToDB(txList);
}

private void incrDeletedBlocksSummary(TxBlockInfo txBlockInfo) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

since this method is used to do rollback, can we rename to something like restoreDeletedBlocksSummary

@aryangupta1998 aryangupta1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the patch, @ChenSammi, some minor comments inline!

Copilot AI review requested due to automatic review settings July 13, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves SCM deleted-block transaction summary handling by ensuring commit processing only happens when the SCM leader is ready, and by keeping the in-memory deletion summary consistent when DB persistence fails.

Changes:

  • Gate DeletedBlockLogImpl#onMessage processing on scmContext.isLeaderReady().
  • Add rollback logic in SCMDeletedBlockTransactionStatusManager to revert summary / txSizeMap updates when DB operations fail.
  • Add additional logging and enrich TxBlockInfo with txId and containerId for better diagnostics.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestDeletedBlockLog.java Updates test construction of TxBlockInfo for the new constructor signature.
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMDeletedBlockTransactionStatusManager.java Adds rollback-on-DB-failure behavior, improves summary initialization logging, and expands TxBlockInfo to carry IDs.
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java Adds leader-ready gating and updates tx-size map population to use the new TxBlockInfo fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@priyeshkaratha priyeshkaratha left a comment

Copy link
Copy Markdown
Contributor

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. Changes LGTM +1

@ChenSammi

Copy link
Copy Markdown
Contributor Author

@aryangupta1998 , could you take another look too?

@aryangupta1998 aryangupta1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing the comments @ChenSammi, LGTM!

@aryangupta1998
aryangupta1998 merged commit 9de98bd into apache:master Jul 13, 2026
45 checks passed
@aryangupta1998

Copy link
Copy Markdown
Contributor

Thanks for the patch, @ChenSammi and @priyeshkaratha, 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.

4 participants