commit 665c053315439e1345aa131f4839945d662fb3f3
Author: Mark Goddard <email address hidden>
Date: Wed Nov 20 12:01:33 2019 +0000
Fix inactive session error in compute node creation
In the fix for bug 1839560 [1][2], soft-deleted compute nodes may be
restored, to ensure we can reuse ironic node UUIDs as compute node
UUIDs. While this seems to largely work, it results in some nasty errors
being generated [3]:
InvalidRequestError This session is in 'inactive' state, due to the
SQL transaction being rolled back; no further SQL can be emitted
within this transaction.
This happens because compute_node_create is decorated with
pick_context_manager_writer, which begins a transaction. While
_compute_node_get_and_update_deleted claims that calling a second
pick_context_manager_writer decorated function will begin a new
subtransaction, this does not appear to be the case.
This change removes pick_context_manager_writer from the
compute_node_create function, and adds a new _compute_node_create
function which ensures the transaction is finished if
_compute_node_get_and_update_deleted is called.
The new unit test added here fails without this change.
This change marks the removal of the final FIXME from the functional
test added in [4].
NOTE(melwitt): The conflict is because change
I9f414cf831316b624132d9e06192f1ecbbd3dd78 (db: Copy docs from
'nova.db.*' to 'nova.db.sqlalchemy.*') is not in Wallaby.
NOTE(melwitt): Difference from the cherry picked change from calling
nova.db.api => nova.db.sqlalchemy.api directly are due to the alembic
migration in Xena which looks to have made the nova.db.api interface
obsolete.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /811809 /opendev. org/openstack/ nova/commit/ 665c053315439e1 345aa131f483994 5d662fb3f3
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit 665c053315439e1 345aa131f483994 5d662fb3f3
Author: Mark Goddard <email address hidden>
Date: Wed Nov 20 12:01:33 2019 +0000
Fix inactive session error in compute node creation
In the fix for bug 1839560 [1][2], soft-deleted compute nodes may be
restored, to ensure we can reuse ironic node UUIDs as compute node
UUIDs. While this seems to largely work, it results in some nasty errors
being generated [3]:
SQL transaction being rolled back; no further SQL can be emitted
within this transaction.
This happens because compute_node_create is decorated with context_ manager_ writer, which begins a transaction. While node_get_ and_update_ deleted claims that calling a second context_ manager_ writer decorated function will begin a new
pick_
_compute_
pick_
subtransaction, this does not appear to be the case.
This change removes pick_context_ manager_ writer from the node_create function, and adds a new _compute_ node_create node_get_ and_update_ deleted is called.
compute_
function which ensures the transaction is finished if
_compute_
The new unit test added here fails without this change.
This change marks the removal of the final FIXME from the functional
test added in [4].
[1] https:/ /bugs.launchpad .net/nova/ +bug/1839560 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=89dd74ac7f1 028daadf86cb189 48e27fe9d1d411 paste.openstack .org/show/ 786350/ /review. opendev. org/#/c/ 695012/
[2] https:/
[3] http://
[4] https:/
Conflicts:
nova/db/ sqlalchemy/ api.py
NOTE(melwitt): The conflict is because change 316b624132d9e06 192f1ecbbd3dd78 (db: Copy docs from sqlalchemy. *') is not in Wallaby.
I9f414cf831
'nova.db.*' to 'nova.db.
NOTE(melwitt): Difference from the cherry picked change from calling sqlalchemy. api directly are due to the alembic
nova.db.api => nova.db.
migration in Xena which looks to have made the nova.db.api interface
obsolete.
Change-Id: Iae119ea8776bc7 f2e5dbe2e502a74 3217beded73 d245fce316b3778 c8ba8e5246)
Closes-Bug: #1853159
Related-Bug: #1853009
(cherry picked from commit 2383cbb4a518821