StaleDataError on heat stack delete

Bug #1444014 reported by Oleg Bondarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Expired
Undecided
Unassigned

Bug Description

When deleting a heat stack with a VM on a subnet connected to external net via DVR router, sometimes following error occures:

2015-04-10 11:01:43.178 11666 ERROR neutron.api.v2.resource [req-333b9ecb-6c49-4146-bb2f-0b0cc827120a ] delete failed
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 83, in resource
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 490, in delete
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource obj_deleter(request.context, id, **kwargs)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/neutron/plugins/ml2/plugin.py", line 1254, in delete_port
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource context, id)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/neutron/db/l3_dvrscheduler_db.py", line 202, in dvr_deletens_if_no_port
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource port_host)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/neutron/db/agents_db.py", line 193, in _get_agent_by_type_and_host
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource Agent.host == host).one()
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2369, in one
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource ret = list(self)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2411, in __iter__
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource self.session._autoflush()
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1198, in _autoflush
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource self.flush()
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1919, in flush
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource self._flush(objects)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2037, in _flush
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource transaction.rollback(_capture_exception=True)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource compat.reraise(exc_type, exc_value, exc_tb)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2001, in _flush
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource flush_context.execute()
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource rec.execute(self)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource uow
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 60, in save_obj
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource mapper, table, update)
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 536, in _emit_update_statements
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource (table.description, len(update), rows))
2015-04-10 11:01:43.178 11666 TRACE neutron.api.v2.resource StaleDataError: UPDATE statement on table 'ml2_dvr_port_bindings' expected to update 1 row(s); 0 were matched.

this prevents VM for deletion and causes stack deletion failure as well.
Most probably StaleDataError is because DVR interface port was concurrently deleted by the time transaction which tries to update record in ml2_dvr_port_bindings table is about to commit (DVR interface deletion deletes the record in ml2_dvr_port_bindings by cascade)

The proposal is to suppress StaleDataError as it actually doesn't mean that anything is broken

Revision history for this message
Oleg Bondarev (obondarev) wrote :

Not able to reproduce to verify the fix, will set to incomplete for now

Changed in neutron:
status: New → Incomplete
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 365 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
assignee: Oleg Bondarev (obondarev) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.