LINBIT / linstor-server

High Performance Software-Defined Block Storage for container, cloud and virtualisation. Fully integrated with Docker, Kubernetes, Openstack, Proxmox etc.
https://docs.linbit.com/docs/linstor-guide/
GNU General Public License v3.0
988 stars 76 forks source link

Respect snap_name parameter for in-progress backups #314

Open blampe opened 2 years ago

blampe commented 2 years ago

Before this change, if any backups were in progress then other snapshot operations driven by the CSI would break.

Concretely, the bug is:

$ curl -H 'Accept: application/json' 'http://piraeus-op-cs.piraeus.svc:3370/v1/remotes/minio/backups?snap_name=INVALID_NAME'
{"linstor":{"pvc-621a06d8-0503-4cf3-84af-d75e1bf40508_back_20220915_234444^snapshot-351f10f6-5b7a-4527-bdd3-0bb7a01bc18a":{"id":"pvc-621a06d8-0503-4cf3-84af-d75e1bf40508_back_20220915_234444^snapshot-351f10f6-5b7a-4527-bdd3-0bb7a01bc18a","start_time":"20220915_234444","start_timestamp":1663285484376,"origin_rsc":"pvc-621a06d8-0503-4cf3-84af-d75e1bf40508","origin_snap":"snapshot-351f10f6-5b7a-4527-bdd3-0bb7a01bc18a","origin_node":"pi4a","vlms":[{"vlm_nr":0,"s3":{"key":"pvc-621a06d8-0503-4cf3-84af-d75e1bf40508_00000_back_20220915_234444^snapshot-351f10f6-5b7a-4527-bdd3-0bb7a01bc18a"}}],"shipping":true,"restorable":false}},"other":{}}

Edit: there also appears to be an issue with getInProgressBackups, because the bug persists even when all backups are successful. I'm not looking into that because the scope of this PR already addresses my immediate problem.

Refs https://github.com/piraeusdatastore/linstor-csi/issues/174