commit 59520d6006ce3d6eccda25d81a5155d5328fbd96
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)
Reviewed: https:/ /review. openstack. org/536940 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=59520d6006c e3d6eccda25d81a 5155d5328fbd96
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 59520d6006ce3d6 eccda25d81a5155 d5328fbd96
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 a4016c610b454be 8269d9b4948 1e0636f8b6507ee 1e48bac6b0)
Change-Id: I616457f094d000
(cherry picked from commit f84781f24600465