Comment 2 for bug 1824435

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

(5:33:08 PM) mriedem: hmm yeah i'm not sure how https://github.com/openstack/nova/blob/03322bb517925a9f5a04ebdb41c3fd31e7962440/nova/db/sqlalchemy/api.py#L3874 can't either return at least 1 or raise
(5:35:47 PM) efried: oh, that part is because there's two rows in the database with the "right" project_id (NULL)
(5:36:05 PM) efried: mriedem: So the initial check (==) fails because there's *more* db rows than expected
(5:36:18 PM) efried: and then the for loop doesn't hit because all the names match (because they're the same)
(5:36:23 PM) mriedem: ah yup
(5:36:35 PM) mriedem: i don't know why the unique constraint doesn't blow up - because NULL isn't considered unique?
(5:36:39 PM) efried: so the problem is that we're somehow creating two rows, and I don't know how that ....
(5:36:42 PM) mriedem: schema.UniqueConstraint('project_id', 'name', 'deleted',
(5:36:42 PM) mriedem: name='uniq_security_groups0project_id0'
(5:36:42 PM) mriedem: 'name0deleted'),