Skip to content

Commit e61051e

Browse files
SQL: Remove snapshot references if primary storage pool has been removed (apache#7205)
1 parent 1a03f69 commit e61051e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

engine/schema/src/main/resources/META-INF/db/schema-41720to41800.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,4 +1569,8 @@ CREATE VIEW `cloud`.`user_view` AS
15691569
left join
15701570
`cloud`.`async_job` ON async_job.instance_id = user.id
15711571
and async_job.instance_type = 'User'
1572-
and async_job.job_status = 0;
1572+
and async_job.job_status = 0;
1573+
1574+
-- Remove snapshot references if primary storage pool has been removed, see github issue #7093
1575+
DELETE FROM `cloud`.`snapshot_store_ref`
1576+
WHERE store_role = "Primary" AND store_id IN (SELECT id FROM storage_pool WHERE removed IS NOT NULL);

0 commit comments

Comments
 (0)