Comment 10 for bug 1743579

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

Reviewed: https://review.opendev.org/640447
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=490edd4cc8015fbfad7ca5866a60316728d3c9fd
Submitter: Zuul
Branch: stable/ocata

commit 490edd4cc8015fbfad7ca5866a60316728d3c9fd
Author: Harald Jensas <email address hidden>
Date: Tue Jan 16 21:15:22 2018 +0100

    Add retry decorator update_segment_host_mapping()

    When multiple agents register at the same time there is
    a possible race condition causing segment host mappings
    updates to fail. StaleDataError raised by SQLAlchemy ORM.

    Adding retry_if_session_inactive() decorator to the method
    fixes the issue.

    Also serialize the method with lockutils. It takes 25+
    seconds to update segment host mappings for 10 agents with
    the retry decorator alone. With the method serialized the
    same operation completes in less than 1 second. The retry
    decorator is still required for active/active scenarios.

    Closes-Bug: #1743579
    Change-Id: I616457f094d000a4016c610b454be8269d9b4948
    (cherry picked from commit f84781f246004651e0636f8b6507ee1e48bac6b0)
    (cherry picked from commit 59520d6006ce3d6eccda25d81a5155d5328fbd96)