Comment 8 for bug 1833445

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/rocky)

Reviewed: https://review.opendev.org/666826
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=72c57893f3f7b382d10c20b0db7a030bfa11be3b
Submitter: Zuul
Branch: stable/rocky

commit 72c57893f3f7b382d10c20b0db7a030bfa11be3b
Author: Lucas Alvares Gomes <email address hidden>
Date: Thu Jun 20 10:53:43 2019 +0100

    Maintenance task: Fix race condition at resource creation

    When the maintenance task runs (every 5 minutes) it should take in
    consideration how old is the resource before considering it to be an
    inconsitency.

    Prior to this patch, what could happen is that a resource being created
    was committed to the neutron database but not yet to the OVN database and
    ovn_revision_numbers cache table. In the meantime, the maintenance
    task could run and create that resource before the create_*_postcommit()
    completed resulting in a race condition.

    Using a port as an example, the following error would be seeing when
    that happens (more detailed example in the LP ticket):

    ovsdbapp.backend.ovs_idl.transaction [-] OVSDB Error:
    {"details":"Transaction causes multiple rows in \"Logical_Switch_Port\"
    table to have identical values (\"89ebd403-68af-43a2-a4e4-5fa86d57d2a2\")
    for index on column \"name\".

    This patch adds a new filter to the get_inconsistent_resources() method
    which checks the "created_at" column of the resource to see if it's older
    than 60 seconds and ignore if it's newer.

    Closes-Bug: #1833445
    Change-Id: If157e9d4660cc6c566ecad44aa6734af2bd14db1
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit 1e0c9370b23315d7e734cf5ebc960e76c454bb61)