Fix race condition in members batch update API call
Fix a potential race condition, the member batch update API call
computes a delta between the current state of the members in the DB and
the members in the requests. But it fetches the members from the DB
before locking the load balancer, it means that another Octavia service
may still update the list of members, then the computation of the
changes may be incorrect.
The list of members is now queried in the locked section.
Closes-Bug: #2036156
Change-Id: I453ff385620f488a3e43d4fda01634cdce3be5d4
(cherry picked from commit 8a47577b7668e6dc82e048d937d1344c667e5124)
(cherry picked from commit 8a5bed4cebd70c1c721a3916dc79f2b19343e445)
(cherry picked from commit 64d9bdb97556652aa05a34276778260b541ad9c6)
(cherry picked from commit 4c97b585ce6e519a5ff090c2cd97fab0e801be0c)
Reviewed: https:/ /review. opendev. org/c/openstack /octavia/ +/896387 /opendev. org/openstack/ octavia/ commit/ 231398ca5fee7b8 25646eeed84523d bfcb414438
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/yoga
commit 231398ca5fee7b8 25646eeed84523d bfcb414438
Author: Gregory Thiemonge <email address hidden>
Date: Fri Sep 15 03:42:26 2023 -0400
Fix race condition in members batch update API call
Fix a potential race condition, the member batch update API call
computes a delta between the current state of the members in the DB and
the members in the requests. But it fetches the members from the DB
before locking the load balancer, it means that another Octavia service
may still update the list of members, then the computation of the
changes may be incorrect.
The list of members is now queried in the locked section.
Closes-Bug: #2036156 8a3e43d4fda0163 4cdce3be5d4 c82e048d937d134 4c667e5124) c721a3916dc79f2 b19343e445) aa05a3427677826 0b541ad9c6) a5ff090c2cd97fa b0e801be0c)
Change-Id: I453ff385620f48
(cherry picked from commit 8a47577b7668e6d
(cherry picked from commit 8a5bed4cebd70c1
(cherry picked from commit 64d9bdb97556652
(cherry picked from commit 4c97b585ce6e519