ironic/releasenotes/notes/remove-excess-allocation-fk-constraints-0f59170f4d164a6e.yaml
Julia Kreger 402c32094b Handle SAWarning around allocations FK Constratins
We have started to notice an SAWarning from sqlalchemy indicating:

  SAWarning: Cannot correctly sort tables; there are unresolvable
      cycles between tables "allocations, nodes", which is usually
      caused by mutually dependent foreign key constraints.
      Foreign key constraints involving these tables will not be
      considered; this warning may raise an error in a future release.

Hunting this down, it appears to be the two data consistency Foreign
Key constraints in the "allocations" table where an allocation would
try to have a conductor_affinity value mapped to conductors.id
and also have a direct association to a node, which *also* had the
same constraint.

And then similarlly, mapping in reverse, asserting a fk constraint,
when nodes also had it's own constraint back on allocations.

Sort of a circular loop.

Anyhow, removes it, and adds a db migration to remove the two
constraints.

Change-Id: I5596008e4971a29c635c45b24cb85db2d0d13ed3
2023-06-26 14:27:59 -07:00

7 lines
234 B
YAML

---
upgrade:
- |
This release removes two internal foreign key constraints which were
redundant and which SQLAlchemy indicated may result in an error at some
point in time. No action is required by an operator for this.