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 17 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
Should Not Be Equal As Strings 0 ${data_checksum}
Container checksums should match ${container} ${data_checksum}
# Check that reconcile CLI returns success. Without fault injection, there is no change expected to the
# container's checksums to inidcate it made a difference
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# container's checksums to inidcate it made a difference
# container's checksums to indicate it made a difference

@@ -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.

new File(containerDataFromDisk.getChunksPath()), new IOException("Missing chunk file " +
chunkFile.getAbsolutePath()));
blockErrors.add(error);
}
} else if (chunk.getChecksumData().getType() != ContainerProtos.ChecksumType.NONE) {
currentTree.addBlock(block.getBlockID().getLocalID());
Copy link
Member

Choose a reason for hiding this comment

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

Can we not add the block when we add the first chunk?

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