ironic/ironic/db
Mark Goddard d8a291a1e1 Fix node update with PostgreSQL
In the node traits RPC object change [1], the _do_update_node method in
the sqlalchemy DB API was modified to use a select query joined with the
node_tags and node_traits tables in the node update DB operation. This
was done to ensure that the returned NodeModel had its tags and traits
attributes populated rather than lazy loaded. This was found not to work
on PostgreSQL, which presents the following error message [2]:

Exception during message handling: DBNotSupportedError:
(psycopg2.NotSupportedError) FOR UPDATE cannot be applied to the
nullable side of an outer join

This issue is resolved in this commit by reverting to the original query
without joins for the node update, and performing a joined query after
the update.

[1] https://review.openstack.org/#/c/532268/13
[2]
http://logs.openstack.org/69/532269/22/check/ironic-tempest-dsvm-pxe_ipmitool-postgres/562b2ea/logs/screen-ir-cond.txt.gz?level=ERROR#_Jan_23_23_59_05_062967

Change-Id: Ib0d49f7e781f1aa0c4496957b00f6c8e3da0ecc0
Related-Bug: #1722194
2018-01-24 20:11:59 +00:00
..
sqlalchemy Fix node update with PostgreSQL 2018-01-24 20:11:59 +00:00
__init__.py Remove copyright from empty files 2014-01-07 21:05:01 +08:00
api.py Add a version argument to traits DB API 2018-01-19 19:28:27 +00:00
migration.py Remove downgrade support from migrations 2016-02-08 15:31:15 +00:00