Comment 14 for bug 1883730

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

Reviewed: https://review.opendev.org/737704
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0cc3032edc7d1cd533789453d19b2a1b2d193d38
Submitter: Zuul
Branch: stable/queens

commit 0cc3032edc7d1cd533789453d19b2a1b2d193d38
Author: Slawek Kaplonski <email address hidden>
Date: Thu Jun 18 23:18:07 2020 +0200

    Make _ensure_default_security_group method atomic

    Method _ensure_default_security_group wasn't atomic as it first tries to get
    default SG and if that not exists in DB, it tries to create it.

    It may happend, like e.g. in Calico plugin that between
    get_default_sg_id method and create_security_group method, this default
    SG will be created by other neutron worker. And in such case there will
    be Duplicate entry exception raised.

    So this patch is adding handling of such exception.

    Conflicts:
        neutron/db/securitygroups_db.py

    Change-Id: I515c310f221e7d9ae3be59a26260538d1bc591c2
    Closes-Bug: #1883730
    (cherry picked from commit 7019c5cf50bc4ad97b302220664a26efaf81a7fd)