Galera deadlock on SELECT FOR UPDATE is not handled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.db |
Fix Released
|
High
|
Roman Podoliaka |
Bug Description
Galera has a known limitation on not being able to handle concurrent SELECT FOR UPDATE queries. If a multiple transactions with SELECT FOR UPDATE statements selecting the same set of rows are executed concurrently, one of them will succeed, while other ones will fail with a deadlock. In order to be able to restart the transaction, we should detect deadlocks properly.
Running nova-api in the wild shows, that at least one additional exception is not currently handled properly:
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack project_
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return f(*args, **kwargs)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return f(*args, **kwargs)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack context, session, project_id, user_id)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack with_lockmode(
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return list(self)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return self._execute_
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack result = conn.execute(
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return meth(self, multiparams, params)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack return connection.
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack compiled_sql, distilled_params
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack context)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack util.raise_
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack reraise(
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack context)
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack cursor.
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack self.errorhandl
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack File "/usr/lib/
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack raise errorclass, errorvalue
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack OperationalError: (OperationalError) (1205, 'Lock wait timeout exceeded; try restarting transaction') 'SELECT quota_usages.
2014-11-19 03:08:52.393 20181 TRACE nova.api.openstack
Changed in oslo.db: | |
milestone: | none → next-kilo |
Changed in oslo.db: | |
status: | Fix Committed → Fix Released |
Fixed in oslo.db by https:/ /review. openstack. org/#/c/ 135674/