Skip to content

fix: return actual validated bytes on checksum mismatch #349

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

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

Conversation

zhenliuxc
Copy link

When a checksum validation fails, the current code returns the total number of bytes read (n) even though some of those bytes have not been verified. This PR changes the error path to return the offset of the first invalid chunk (chunkOff) instead.

  • Guarantees that only successfully-verified data is ever returned to the caller.
  • Triggers an immediate failover to the next DataNode on the next Read call.

The change is minimal and preserves all existing retry / failover semantics.

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.

1 participant