-
Notifications
You must be signed in to change notification settings - Fork 225
fix: consider only non-zero blocks for GetMetadataAllocated #579
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
fix: consider only non-zero blocks for GetMetadataAllocated #579
Conversation
|
|
|
Welcome @iPraveenParihar! |
|
Hi @iPraveenParihar. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The `GetMetadataAllocated` method previously returned all blocks, including zero-filled ones (usually, unallocated/unused). This commit updates the method to return only allocated (non-zero) blocks. Signed-off-by: Praveen M <[email protected]>
a7e249a to
2d2a8d9
Compare
| blockIndex++ | ||
| continue | ||
| // return only allocated blocks. | ||
| if blockChanged(zeroBlock, tBuffer[:targetReadBytes]) { |
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.
Does this work when a change wrote a whole lot of zero bytes over existing data to the volume?
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.
I guess it should be fine, as cb.base == nil here.
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.
This is for GetMetadataAllocated, where the backup application requires only the allocated data from the snapshot. During restoration, any uninitialized bytes will be filled with zeroes anyway.
|
/ok-to-test |
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.
Looks good to me
|
/lgtm |
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.
/lgtm
|
Please add a release note. |
|
/approve /hold we can remove hold after a release note is added. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iPraveenParihar, PrasadG193, Rakshith-R, xing-yang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hey @xing-yang The API implementation pr went was merged in december 2024 The last release was in september 2024 https://github.com/kubernetes-csi/csi-driver-host-path/releases/tag/v1.15.0 This pr would fix the implementation before it is present in a release. |
|
added release note. PTAL @xing-yang 😃 |
|
/cc @xing-yang |
|
/hold cancel |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The
GetMetadataAllocatedmethod previously returned all blocks,including zero-filled ones (usually, unallocated/unused).
This commit updates the method to return only allocated (non-zero) blocks.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: