Comment 6 for bug 1762687

Revision history for this message
Matt Riedemann (mriedem) wrote :

(10:54:09 AM) mriedem: the solution to fix the race with attaching the same volume to the same instance concurrently is a unique constraint on the bdms table over the volume_id and instance_uuid columns
(10:54:16 AM) mriedem: but that doesn't fix lyarwood's new bug
(10:55:11 AM) mriedem: you can't put a unique constraint on just the volume_id column since that would break multiattach
(10:55:35 AM) mriedem: you almost need a conditional constraint, where volume_id must be unique if multiattach=False
(10:55:46 AM) mriedem: but there is no such thing as a conditional unique constraint is there?
(10:56:10 AM) mriedem: and jaypibbles ran off
(10:56:29 AM) dansmith: mriedem: I think you need an active=$id column to do that
(10:56:39 AM) dansmith: that's why we have deleted=$id I think
(10:56:47 AM) mriedem: https://en.wikipedia.org/wiki/Check_constraint