-
Notifications
You must be signed in to change notification settings - Fork 517
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-10374. Make container scanner generate merkle trees during the scan #7490
base: HDDS-10239-container-reconciliation
Are you sure you want to change the base?
HDDS-10374. Make container scanner generate merkle trees during the scan #7490
Conversation
…anner-builds-mt * HDDS-10239-container-reconciliation: HDDS-10928. Implement container comparison logic within datanodes. (apache#7293)
Missing chunks are incorrectly reported as corrupted
Metadata scanner integration tests are passing
@@ -1348,7 +1358,6 @@ public void markContainerUnhealthy(Container container, ScanResult reason) | |||
} finally { | |||
container.writeUnlock(); | |||
} | |||
createContainerMerkleTree(container); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a container moves from OPEN
to UNHEALTHY
state we should try to build a merkle tree with whatever data we have at the moment before the scanner builds the actual merkle tree. If for some reason (either metadata/data error) we are unable to build it, then we can log the exception and move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when we have an unhealthy container we should build the tree from the actual data, but this method only builds the tree from the metadata. I'm renaming it in the next commit to make that clearer. We should not depend on just the metadata if we suspect corruption. The way this should work is open -> unhealthy would trigger an on-demand scan of the container, but that code path is not in place right now. We may want to add that to our branch actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should add the on-demand scan here to generate the Merkle tree.
...service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the change looks good to me. I have left a minor comment to my previous comment.
What changes were proposed in this pull request?
Summary
Allow the container scanner to update the container Merkle Tree with the currently calculated hashes of what is on disk. If the tree does not already exist, it will be created. Even if the container is unhealthy, the merkle tree should still be updated to reflect the current state of the container. Hashes stored in RocksDB that were given by the client during write will not be modified.
What is the link to the Apache JIRA
HDDS-10374
How was this patch tested?
KeyValueContainerCheck
modifiedMore robust testing of fault combinations will be added later using the framework being developed under HDDS-11942