Comment 27 for bug 1757966

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to mistral (stable/pike)

Reviewed: https://review.openstack.org/569081
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=ae426bf6fe4eb11431f1008e7065ec6aa0383a33
Submitter: Zuul
Branch: stable/pike

commit ae426bf6fe4eb11431f1008e7065ec6aa0383a33
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
    Change-Id: I36988817fb8e7695094ef98958b8aa151208fadb
    (cherry picked from commit afb0f584c5f1218ec73b2b6ecd9d7509c1df4594)