SQL: Remove snapshot references if primary storage pool has been removed (#7205)

This commit is contained in:
Wei Zhou 2023-02-21 14:48:36 +01:00 committed by GitHub
parent 1a03f69a3a
commit e61051e4fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1570,3 +1570,7 @@ CREATE VIEW `cloud`.`user_view` AS
`cloud`.`async_job` ON async_job.instance_id = user.id
and async_job.instance_type = 'User'
and async_job.job_status = 0;
-- Remove snapshot references if primary storage pool has been removed, see github issue #7093
DELETE FROM `cloud`.`snapshot_store_ref`
WHERE store_role = "Primary" AND store_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL);