Skip to content
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

deleting snapshotclass is marking volumesnapshot readyToUse as false #432

Closed
Madhu-1 opened this issue Dec 1, 2020 · 3 comments · Fixed by #433
Closed

deleting snapshotclass is marking volumesnapshot readyToUse as false #432

Madhu-1 opened this issue Dec 1, 2020 · 3 comments · Fixed by #433
Assignees

Comments

@Madhu-1
Copy link
Contributor

Madhu-1 commented Dec 1, 2020

deleting the snapshot class which is used to create volume snapshots is leading to marking all volume snapshot readyToUse as false

steps to reproduce:-

  • create volumesnapshotclass
  • create volumesnapshot
  • wait till readyToUse is set to true
  • Now delete the volumesnapshotclass
  • check readyToUse on volumesnapshot

logs of snapshot controller

I1201 04:44:46.953076       1 reflector.go:369] github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions/factory.go:117: forcing resync
I1201 04:44:46.953295       1 snapshot_controller_base.go:158] enqueued "default/rbd-pvc-snapshot" for sync
I1201 04:44:46.953349       1 snapshot_controller_base.go:202] syncSnapshotByKey[default/rbd-pvc-snapshot]
I1201 04:44:46.953366       1 snapshot_controller_base.go:205] snapshotWorker: snapshot namespace [default] name [rbd-pvc-snapshot]
I1201 04:44:46.953381       1 snapshot_controller_base.go:328] checkAndUpdateSnapshotClass [rbd-pvc-snapshot]: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
I1201 04:44:46.953393       1 snapshot_controller.go:1178] getSnapshotClass: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
E1201 04:44:46.953415       1 snapshot_controller.go:1182] failed to retrieve snapshot class csi-rbdplugin-snapclass from the informer: "volumesnapshotclass.snapshot.storage.k8s.io \"csi-rbdplugin-snapclass\" not found"
E1201 04:44:46.953477       1 snapshot_controller_base.go:331] checkAndUpdateSnapshotClass failed to getSnapshotClass volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found
I1201 04:44:46.953525       1 snapshot_controller.go:721] updateSnapshotStatusWithEvent[default/rbd-pvc-snapshot]
I1201 04:44:46.953539       1 snapshot_controller.go:724] updateSnapshotStatusWithEvent[rbd-pvc-snapshot]: the same error &{2020-12-01 04:37:46 +0000 UTC 0xc0004baf90} is already set
I1201 04:44:46.953602       1 snapshot_controller_base.go:192] Failed to sync snapshot "default/rbd-pvc-snapshot", will retry again: volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found
I1201 04:45:46.894293       1 reflector.go:369] github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions/factory.go:117: forcing resync
I1201 04:45:46.894521       1 snapshot_controller_base.go:175] enqueued "snapcontent-7a477074-ecd2-464c-a925-1892e8b2f419" for sync
I1201 04:45:46.894710       1 snapshot_controller_base.go:277] syncContentByKey[snapcontent-7a477074-ecd2-464c-a925-1892e8b2f419]
I1201 04:45:46.894864       1 util.go:264] storeObjectUpdate updating content "snapcontent-7a477074-ecd2-464c-a925-1892e8b2f419" with version 102029
I1201 04:45:46.895012       1 snapshot_controller.go:86] synchronizing VolumeSnapshotContent[snapcontent-7a477074-ecd2-464c-a925-1892e8b2f419]: content is bound to snapshot default/rbd-pvc-snapshot
I1201 04:45:46.895148       1 snapshot_controller.go:88] syncContent[snapcontent-7a477074-ecd2-464c-a925-1892e8b2f419]: check if we should add invalid label on content
I1201 04:45:46.895289       1 snapshot_controller.go:1370] getSnapshotFromStore: snapshot default/rbd-pvc-snapshot found
I1201 04:45:46.895453       1 snapshot_controller.go:991] needsUpdateSnapshotStatus[default/rbd-pvc-snapshot]
I1201 04:45:46.895740       1 snapshot_controller.go:143] synchronizing VolumeSnapshotContent for snapshot [default/rbd-pvc-snapshot]: update snapshot status to true if needed.
I1201 04:45:46.895980       1 snapshot_controller_base.go:202] syncSnapshotByKey[default/rbd-pvc-snapshot]
I1201 04:45:46.897389       1 snapshot_controller_base.go:205] snapshotWorker: snapshot namespace [default] name [rbd-pvc-snapshot]
I1201 04:45:46.897424       1 snapshot_controller_base.go:328] checkAndUpdateSnapshotClass [rbd-pvc-snapshot]: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
I1201 04:45:46.897431       1 snapshot_controller.go:1178] getSnapshotClass: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
E1201 04:45:46.897448       1 snapshot_controller.go:1182] failed to retrieve snapshot class csi-rbdplugin-snapclass from the informer: "volumesnapshotclass.snapshot.storage.k8s.io \"csi-rbdplugin-snapclass\" not found"
E1201 04:45:46.897523       1 snapshot_controller_base.go:331] checkAndUpdateSnapshotClass failed to getSnapshotClass volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found
I1201 04:45:46.897545       1 snapshot_controller.go:721] updateSnapshotStatusWithEvent[default/rbd-pvc-snapshot]
I1201 04:45:46.897554       1 snapshot_controller.go:724] updateSnapshotStatusWithEvent[rbd-pvc-snapshot]: the same error &{2020-12-01 04:37:46 +0000 UTC 0xc0004baf90} is already set
I1201 04:45:46.897624       1 snapshot_controller_base.go:192] Failed to sync snapshot "default/rbd-pvc-snapshot", will retry again: volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found
I1201 04:45:46.955714       1 reflector.go:369] github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions/factory.go:117: forcing resync
I1201 04:45:46.955856       1 snapshot_controller_base.go:158] enqueued "default/rbd-pvc-snapshot" for sync
I1201 04:45:46.955909       1 snapshot_controller_base.go:202] syncSnapshotByKey[default/rbd-pvc-snapshot]
I1201 04:45:46.955925       1 snapshot_controller_base.go:205] snapshotWorker: snapshot namespace [default] name [rbd-pvc-snapshot]
I1201 04:45:46.955938       1 snapshot_controller_base.go:328] checkAndUpdateSnapshotClass [rbd-pvc-snapshot]: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
I1201 04:45:46.955947       1 snapshot_controller.go:1178] getSnapshotClass: VolumeSnapshotClassName [csi-rbdplugin-snapclass]
E1201 04:45:46.955963       1 snapshot_controller.go:1182] failed to retrieve snapshot class csi-rbdplugin-snapclass from the informer: "volumesnapshotclass.snapshot.storage.k8s.io \"csi-rbdplugin-snapclass\" not found"
E1201 04:45:46.956023       1 snapshot_controller_base.go:331] checkAndUpdateSnapshotClass failed to getSnapshotClass volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found
I1201 04:45:46.956043       1 snapshot_controller.go:721] updateSnapshotStatusWithEvent[default/rbd-pvc-snapshot]
I1201 04:45:46.956068       1 snapshot_controller.go:724] updateSnapshotStatusWithEvent[rbd-pvc-snapshot]: the same error &{2020-12-01 04:37:46 +0000 UTC 0xc0004baf90} is already set
I1201 04:45:46.956135       1 snapshot_controller_base.go:192] Failed to sync snapshot "default/rbd-pvc-snapshot", will retry again: volumesnapshotclass.snapshot.storage.k8s.io "csi-rbdplugin-snapclass" not found

@Madhu-1
Copy link
Contributor Author

Madhu-1 commented Dec 1, 2020

cc @xing-yang

@xing-yang
Copy link
Collaborator

@Madhu-1 which version of external-snapshotter are you testing with?

@xing-yang
Copy link
Collaborator

xing-yang commented Dec 14, 2020

Current fix: Update updateSnapshotStatusWithEvent to include a "setReadyToFalse bool" input parameter. If false, ReadyToUse will not be changed.

  • If snapshot class is not found, ReadyToUse will not be changed.
  • If updateSnapshotStatus failed, ReadyToUse will not be changed.
  • For all other cases, the code stays the same as before, meaning ReadyToUse will be False.

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 a pull request may close this issue.

2 participants