Fix reservation_commit so it works w/ PostgreSQL.
Update the Reservation model so that the 'usage' relationship is explicitly forced to use an inner join. This fixes an issue on PostgreSQL which doesn't support 'SELECT FOR UPDATE' on outer joined queries. Fixes LP Bug #1003756. Change-Id: I3c40bd8481855a18391e12d7411762e91b1ef8b0
This commit is contained in:
@@ -465,9 +465,11 @@ class Reservation(BASE, NovaBase):
|
||||
uuid = Column(String(36), nullable=False)
|
||||
|
||||
usage_id = Column(Integer, ForeignKey('quota_usages.id'), nullable=False)
|
||||
# NOTE(dprince): Force innerjoin below for lockmode update on PostgreSQL
|
||||
usage = relationship(QuotaUsage,
|
||||
backref=backref('reservations'),
|
||||
foreign_keys=usage_id,
|
||||
innerjoin=True,
|
||||
primaryjoin='and_('
|
||||
'Reservation.usage_id == QuotaUsage.id,'
|
||||
'Reservation.deleted == False)')
|
||||
|
||||
Reference in New Issue
Block a user