Skip to content

Conversation

@iPraveenParihar
Copy link
Contributor

@iPraveenParihar iPraveenParihar commented Jan 8, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:

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.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Fixed: Considered only non-zero blocks for GetMetadataAllocated.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 8, 2025
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 8, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: iPraveenParihar / name: Praveen M (2d2a8d9)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @iPraveenParihar!

It looks like this is your first PR to kubernetes-csi/csi-driver-host-path 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/csi-driver-host-path has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 8, 2025
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]>
@iPraveenParihar iPraveenParihar force-pushed the fix/allocated-non-zero-blocks branch from a7e249a to 2d2a8d9 Compare January 9, 2025 05:15
blockIndex++
continue
// return only allocated blocks.
if blockChanged(zeroBlock, tBuffer[:targetReadBytes]) {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 15, 2025
@Rakshith-R
Copy link

/ok-to-test
/cc @carlbraganza @PrasadG193

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 20, 2025
Copy link

@Rakshith-R Rakshith-R left a 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

@nixpanic
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2025
@nixpanic nixpanic removed their assignment Jan 21, 2025
Copy link
Contributor

@PrasadG193 PrasadG193 left a comment

Choose a reason for hiding this comment

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

/lgtm

@xing-yang
Copy link
Contributor

Please add a release note.

@xing-yang
Copy link
Contributor

/approve

/hold we can remove hold after a release note is added.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2025
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2025
@Rakshith-R
Copy link

we can remove hold after a release note is added.

Hey @xing-yang

The API implementation pr went was merged in december 2024
#569 (comment)

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.
Do we still need a release note in this case where the bug is never present in a previous release?

@iPraveenParihar
Copy link
Contributor Author

added release note. PTAL @xing-yang 😃

@iPraveenParihar
Copy link
Contributor Author

/cc @xing-yang

@xing-yang
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 5, 2025
@k8s-ci-robot k8s-ci-robot merged commit b0c4588 into kubernetes-csi:master Mar 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants