Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-12150. Abnormal container states should not crash the SCM ContainerReportHandler thread #7882

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smengcl
Copy link
Contributor

@smengcl smengcl commented Feb 14, 2025

What changes were proposed in this pull request?

Ignore (and log) the abnormal container (with lower BCSID) reported by a datanode in order to not crash the ContainerReportHandler thread.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-12150

How was this patch tested?

  • Add UT testQuasiClosedToClosedAttemptWithMismatchingBCSID in TestContainerReportHandler
  • Add UT testClosingToQuasiClosedWithMismatchingBCSID in TestContainerReportHandler
  • Add UT in TestIncrementalContainerReportHandler ?

@smengcl smengcl added the bug Something isn't working label Feb 14, 2025
@smengcl smengcl self-assigned this Feb 14, 2025
Comment on lines 309 to +314
logger.info("Moving container {} to CLOSED state, datanode {} " +
"reported CLOSED replica with index {}.", containerId, datanode,
replica.getReplicaIndex());
if (!verifyBcsId(replica.getBlockCommitSequenceId(), container.getSequenceId(), datanode, containerId)) {
return true; // ignored = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logger.info should come after verifyBcsId.

Comment on lines +381 to +389
* Helper method to verify that the replica's bcsId matches the container's in SCM.
* Throws IOException if the bcsIds do not match.
* <p>
* @param replicaBcsId Replica bcsId
* @param containerBcsId Container bcsId in SCM
* @param datanode DatanodeDetails for logging
* @param containerId ContainerID for logging
* @return true if verification has passed, false otherwise
* @throws IOException Thrown when bcsIds do not match
Copy link
Contributor

Choose a reason for hiding this comment

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

The method doesn't throw IOException if the bcsIds do not match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants