longhorn / longhorn

Cloud-Native distributed storage built on and for Kubernetes
https://longhorn.io
Apache License 2.0
6.04k stars 595 forks source link

[BUG] Can not delete the parent of volume head snapshot of a v2 volume #9064

Open chriscchien opened 2 months ago

chriscchien commented 2 months ago

Describe the bug

A v2 volume have two snapshots, delete the parent of volume head snapshot not work(v1 volume can perform this action without problems).

failed to delete snapshot: proxyServer=10.42.2.103:8501 destination=10.42.2.103:20006: failed to remove snapshot [140358b0-24f4-4f93-be26-ab001dfe7bb5]: rpc error: code = Unknown desc = failed to delete SPDK engine pvc-88bb8546-54b6-4399-b57d-2a5d92ccafc7-e-0 snapshot 140358b0-24f4-4f93-be26-ab001dfe7bb5: rpc error: code = Unknown desc = engine pvc-88bb8546-54b6-4399-b57d-2a5d92ccafc7-e-0 cannot delete snapshot 140358b0-24f4-4f93-be26-ab001dfe7bb5 since it is the parent of volume head

To Reproduce

  1. Create a v2 volume with workload
  2. Write 100MB to file1 and take snapshot1
  3. Write 100MB to file2 and take snapshot2
  4. Delete snapshot2
  5. The delete failed

Expected behavior

Delete the v2 volume parent of volume head snapshot should work as v1 volume

Support bundle for troubleshooting

supportbundle_b37b319b-9dff-4925-8658-8839c5c7f0bd_2024-07-23T08-34-33Z.zip

Environment

Additional context

Can reproduced in v1.6.2

derekbit commented 2 months ago

@chriscchien Does it happen in v1.6.2?

chriscchien commented 2 months ago

@chriscchien Does it happen in v1.6.2?

Yes this issue can be reproduced in v1.6.2

derekbit commented 2 months ago

I see. IIRC, this is a known issue.

derekbit commented 2 months ago

https://github.com/longhorn/longhorn/issues/7573 purohits the operation. We need to clarify the v1 andv2 operations.

derekbit commented 2 months ago

cc @shuo-wu

shuo-wu commented 2 months ago

IIRC SPDK allows deleting a snapshot directly behind the head. But I haven't tested it thoroughly.