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-10374. Make container scanner generate merkle trees during the scan #7490

Open
wants to merge 18 commits into
base: HDDS-10239-container-reconciliation
Choose a base branch
from

Conversation

errose28
Copy link
Contributor

@errose28 errose28 commented Nov 26, 2024

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?

  • Unit tests for scanners modified
  • Integration tests for scanners modified
  • Unit tests for KeyValueContainerCheck modified

More robust testing of fault combinations will be added later using the framework being developed under HDDS-11942

@errose28 errose28 marked this pull request as ready for review January 9, 2025 17:45
@@ -1348,7 +1358,6 @@ public void markContainerUnhealthy(Container container, ScanResult reason)
} finally {
container.writeUnlock();
}
createContainerMerkleTree(container);
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

@aswinshakil aswinshakil left a 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.

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

Successfully merging this pull request may close these issues.

2 participants