Comment 13 for bug 1883730

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

Reviewed: https://review.opendev.org/737702
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=13f8296d5c1bf0e2bc90ee689a4825ec9acf8881
Submitter: Zuul
Branch: stable/stein

commit 13f8296d5c1bf0e2bc90ee689a4825ec9acf8881
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)