Skip to content

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

Open
ChenSammi wants to merge 1 commit into
apache:masterfrom
ChenSammi:HDDS-15726
Open

HDDS-15726. Improve SCM block deletion summary error handling#10650
ChenSammi wants to merge 1 commit 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!

Comment on lines +510 to +513
if (!scmContext.isLeaderReady()) {
LOG.warn("SCM is not ready to commit transactions.");
return;
}

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.

Suggested change
if (!scmContext.isLeaderReady()) {
LOG.warn("SCM is not ready to commit transactions.");
return;
}
if (!scmContext.isLeaderReady()) {
LOG.debug("Skip commit transactions since SCM leader is not ready yet.");
return;
}

onMessage() now logs at WARN for non-ready leader, this can spam logs during leader warm-up because this path is heartbeat-driven, can we change it to debug?

totalBlockCount.addAndGet(txBlockInfo.getTotalBlockCount());
totalBlocksSize.addAndGet(txBlockInfo.getTotalBlockSize());
totalReplicatedBlocksSize.addAndGet(txBlockInfo.getTotalReplicatedBlockSize());
LOG.debug("Increase summary for {} to {}", txBlockInfo, summaryToString(getSummary()));

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.

Suggested change
LOG.debug("Increase summary for {} to {}", txBlockInfo, summaryToString(getSummary()));
if (LOG.isDebugEnabled()) {
LOG.debug("Increase summary for {} to {}", txBlockInfo, summaryToString(getSummary()));
}

Same we can do for,

descDeletedBlocksSummary(TxBlockInfo txBlockInfo)
descDeletedBlocksSummary(DeletedBlocksTransaction tx)

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