Comment 15 for bug 1731668

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.opendev.org/756637
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d696a636bbd8c07bd8c609abfcb513453757b1fc
Submitter: Zuul
Branch: stable/queens

commit d696a636bbd8c07bd8c609abfcb513453757b1fc
Author: melanie witt <email address hidden>
Date: Thu Oct 8 02:41:02 2020 +0000

    [stable-only] Use a separate transaction for reading after race

    As part of data migration code to ensure a Project/User record,
    integrated placement creates a record if it does not exist. However,
    during a race situation, the logic to read back a record written by
    a racing request fails because a change written in a separate
    transaction will not be reflected in the current transaction when the
    isolation level is REPEATABLE_READ (the default):

      https://dev.mysql.com/doc/refman/8.0/en/innodb-transaction-isolation-levels.html

    This changes the read after catching DBDuplicateEntry to occur in a
    separate transaction so it can pick up the change written by the racing
    parallel request.

    Note: this is a stable-only change because the placement code
    containing the bug was temporary data-transitioning code that no longer
    exists in placement after Queens.

    Closes-Bug: #1731668

    Change-Id: Ic90beaaa9848a4f39f4223f31a55cd2c681959cd