* Using "passive_deletes=True" when configuring relationships
with SQLAlchemy significantly reduces memory footprint when
deleting a graph of objects (e.g. root workflow execution
with all dependent tasks, actions and sub workflows) from DB.
This happens because in this case SQLAlchemy doesn't load
those dependent objects that are not yet in the session and
rather relies on cascading mechanisms of databases which are
activated by the proper configuration of foreign key columns.
For example, "ON DELETE CASCADE" clause in the foreign key
definition in case of for MySQL.
Particularly, this change reduces memory footprint of API
processes when deleting large graphs of executions and
execution expiration policy mechanism where the same happens
but on the engine side.
* Added a test to make sure that cascaded deletion works well
with this new property.
Related-Bug: #1757966
Change-Id: I36988817fb8e7695094ef98958b8aa151208fadb
(cherry picked from commit afb0f584c5f1218ec73b2b6ecd9d7509c1df4594)
Reviewed: https:/ /review. openstack. org/569081 /git.openstack. org/cgit/ openstack/ mistral/ commit/ ?id=ae426bf6fe4 eb11431f1008e70 65ec6aa0383a33
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit ae426bf6fe4eb11 431f1008e7065ec 6aa0383a33
Author: Renat Akhmerov <email address hidden>
Date: Mon May 14 17:09:29 2018 +0700
Use "passive_ deletes= True" in ORM relationships
* Using "passive_ deletes= True" when configuring relationships
with SQLAlchemy significantly reduces memory footprint when
deleting a graph of objects (e.g. root workflow execution
with all dependent tasks, actions and sub workflows) from DB.
This happens because in this case SQLAlchemy doesn't load
those dependent objects that are not yet in the session and
rather relies on cascading mechanisms of databases which are
activated by the proper configuration of foreign key columns.
For example, "ON DELETE CASCADE" clause in the foreign key
definition in case of for MySQL.
Particularly, this change reduces memory footprint of API
processes when deleting large graphs of executions and
execution expiration policy mechanism where the same happens
but on the engine side.
* Added a test to make sure that cascaded deletion works well
with this new property.
Related-Bug: #1757966 95094ef98958b8a a151208fadb ec73b2b6ecd9d75 09c1df4594)
Change-Id: I36988817fb8e76
(cherry picked from commit afb0f584c5f1218