Skip to content

rbd: include trashed parents in clone depth checks - #6500

Open
YiteGu wants to merge 2 commits into
ceph:develfrom
YiteGu:trashed-parents-in-clone-depth-checks
Open

rbd: include trashed parents in clone depth checks#6500
YiteGu wants to merge 2 commits into
ceph:develfrom
YiteGu:trashed-parents-in-clone-depth-checks

Conversation

@YiteGu

@YiteGu YiteGu commented Aug 25, 2026

Copy link
Copy Markdown
Member

Open parent images by ID while walking clone ancestry so trashed
parents can still be included in clone depth calculation. Keep ID-based
opens scoped to this traversal path, and flatten snapshot-backed images
instead of the source volume when restoring from snapshots.

Describe what this PR does

Provide some context for the reviewer

Is there anything that requires special attention

Do you have any questions?

Is the change backward compatible?

Are there concerns around backward compatibility?

Provide any external context for the change, if any.

For example:

  • Kubernetes links that explain why the change is required
  • CSI spec related changes/catch-up that necessitates this patch
  • golang related practices that necessitates this change

Related issues

Mention any github issues relevant to this PR. Adding below line
will help to auto close the issue once the PR is merged.

Fixes: #issue_number

Future concerns

List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

@YiteGu
YiteGu requested review from a team as code owners August 25, 2026 15:10
@YiteGu YiteGu changed the title Trashed parents in clone depth checks rbd: include trashed parents in clone depth checks Aug 25, 2026
@mergify mergify Bot added the component/rbd Issues related to RBD label Aug 25, 2026
@YiteGu
YiteGu force-pushed the trashed-parents-in-clone-depth-checks branch 2 times, most recently from a549f16 to d4c7829 Compare August 26, 2026 02:56
@Rakshith-R
Rakshith-R requested a balanced review from Copilot August 26, 2026 06:39
@Rakshith-R

Copy link
Copy Markdown
Contributor

@Mergifyio rebase

@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

rebase

🛑 The pull request rule doesn't match anymore

Details

This action has been cancelled.

@ceph-csi-bot
ceph-csi-bot force-pushed the trashed-parents-in-clone-depth-checks branch from d4c7829 to 58b68a6 Compare August 26, 2026 06:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates RBD clone-depth traversal to include trashed ancestors and flatten the correct snapshot-backed image.

Changes:

  • Opens ancestor images by ID during depth checks.
  • Flattens snapshot backing images during restores.
  • Adds end-to-end coverage and polling helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/rbd/rbd_util.go Adds ID-based ancestry traversal.
internal/rbd/controllerserver.go Targets snapshot backing images for flattening.
e2e/rbd.go Tests trashed-parent clone-depth behavior.
e2e/rbd_helper.go Adds trash and flatten polling helpers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/rbd/rbd_util.go
Comment thread e2e/rbd.go
@Rakshith-R

Copy link
Copy Markdown
Contributor

/test ci/centos/mini-e2e-operator/k8s-1.35

@Rakshith-R

Copy link
Copy Markdown
Contributor

https://jenkins-ceph-csi.apps.ocp.cloud.ci.centos.org/job/mini-e2e-operator_k8s-1.35/18/display/redirect
Triggered full ci

After it passes, can you please move the testcase into helper function in another file + add more comments ?
rbd.go is already very huge

Thanks

@YiteGu

YiteGu commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

After it passes, can you please move the testcase into helper function in another file + add more comments ?

Okay.

@YiteGu

YiteGu commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

test passed from e2e log report. Failure seems to have nothing to do with it.

@YiteGu
YiteGu force-pushed the trashed-parents-in-clone-depth-checks branch from 38187da to b6b805e Compare August 26, 2026 14:28
@YiteGu

YiteGu commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

https://jenkins-ceph-csi.apps.ocp.cloud.ci.centos.org/job/mini-e2e-operator_k8s-1.35/18/display/redirect Triggered full ci

After it passes, can you please move the testcase into helper function in another file + add more comments ? rbd.go is already very huge

Thanks

updated

@YiteGu

YiteGu commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e-operator/k8s-1.35

1 similar comment
@Rakshith-R

Copy link
Copy Markdown
Contributor

/test ci/centos/mini-e2e-operator/k8s-1.35

Comment thread internal/rbd/rbd_util.go Outdated
Comment thread internal/rbd/rbd_util.go Outdated
Comment thread internal/rbd/rbd_util.go
@YiteGu
YiteGu force-pushed the trashed-parents-in-clone-depth-checks branch from b6b805e to c7e0715 Compare August 27, 2026 08:35
@YiteGu

YiteGu commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e-operator/k8s-1.35

1 similar comment
@YiteGu

YiteGu commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e-operator/k8s-1.35

@YiteGu
YiteGu force-pushed the trashed-parents-in-clone-depth-checks branch from c7e0715 to faa12fa Compare August 28, 2026 08:01
@YiteGu

YiteGu commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e-operator/k8s-1.35

1 similar comment
@YiteGu

YiteGu commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e-operator/k8s-1.35

@iPraveenParihar

Copy link
Copy Markdown
Contributor

/queue

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

@Mergifyio rebase

@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

rebase

🛑 The pull request rule doesn't match anymore

Details

This action has been cancelled.

Open parent images by ID while walking clone ancestry so trashed
parents can still be included in clone depth calculation. Keep ID-based
opens scoped to this traversal path, and flatten snapshot-backed images
instead of the source volume when restoring from snapshots.

Signed-off-by: Yite Gu <guyite@bytedance.com>
Add an RBD e2e case that builds a snapshot restore chain with parents in
trash and verifies that clone depth is still counted deeply enough to
trigger flattening.

Signed-off-by: Yite Gu <guyite@bytedance.com>
@ceph-csi-bot
ceph-csi-bot force-pushed the trashed-parents-in-clone-depth-checks branch from c92cadf to 59a6b37 Compare September 2, 2026 13:54
@ceph-csi-bot ceph-csi-bot added ok-to-test Label to trigger E2E tests and removed queued/rebase labels Sep 2, 2026
@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.36

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.36

@ceph-csi-bot ceph-csi-bot added ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. and removed ok-to-test Label to trigger E2E tests labels Sep 2, 2026
@mergify mergify Bot removed the ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. label Sep 2, 2026
@nixpanic

nixpanic commented Sep 2, 2026

Copy link
Copy Markdown
Member

/test ci/centos/k8s-e2e-external-storage/1.35

@nixpanic

nixpanic commented Sep 2, 2026

Copy link
Copy Markdown
Member

/test ci/centos/k8s-e2e-external-storage/1.35

Failed deploying minikube/rook.

@iPraveenParihar

Copy link
Copy Markdown
Contributor

/retest ci/centos/mini-e2e/k8s-1.34

@iPraveenParihar

Copy link
Copy Markdown
Contributor
  I0902 18:14:47.122967   84830 nfs.go:1005] checksum for clone is 8
  I0902 18:14:47.122984   84830 nfs.go:1021] failed to create PVC and app (1a76b5f3-41e3-4b4d-8a36-b78e315f0cc7-0): failed to get app: client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
  I0902 18:14:47.122997   84830 nfs.go:1021] failed to create PVC and app (1a76b5f3-41e3-4b4d-8a36-b78e315f0cc7-1): context deadline exceeded
  I0902 18:14:48.561796   84830 exec_util.go:206] unexpected error trying to use websockets for pod exec: command terminated with exit code 39
  I0902 18:14:48.561837   84830 pod.go:249] failed to execute command: command terminated with exit code 39
  I0902 18:14:48.561851   84830 pod.go:324] stdErr occurred: Error ENOTEMPTY: subvolume group csi contains subvolume(s) or retained snapshots of deleted subvolume(s)

  I0902 18:14:48.561860   84830 utils.go:2149] failed to delete subvolumegroup csi: failed to exec command in toolbox: failed to execute command: command terminated with exit code 39
  �[38;5;9m[FAILED]�[0m in [AfterEach] - /go/src/github.com/ceph/ceph-csi/e2e/utils.go:2150 �[38;5;243m@ 09/02/26 18:14:48.562�[0m

@iPraveenParihar

Copy link
Copy Markdown
Contributor

/retest ci/centos/mini-e2e/k8s-1.34

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

Labels

component/rbd Issues related to RBD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants