octavia/releasenotes/notes/fix-batch-member-update-race-condition-09b82e2cc3121e03.yaml
Gregory Thiemonge 499bbaef3d Fix ORM caching for with_for_update calls
The SQLAlchemy recommends to use populate_existing() when using
with_for_update() [0], it fixed issues with the caching of the objects.

This patch precisely fixes a bug when locking of a loadbalancer in the
batch member update API call, the load balancer might not have been
locked correctly and race conditions could have occurred (processing
simultaneously 2 requests in the workers for the same load balancer).

[0] https://docs.sqlalchemy.org/en/14/orm/query.html#sqlalchemy.orm.Query.with_for_update

Story 2010646
Task 47642

Co-Authored-By: Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>

Merge conflict:
    octavia/db/repositories.py

Change-Id: Ibd4da09079e83789d6cfe3658fcf1f266f5cf8b4
(cherry picked from commit 2e4ee9c65e)
2023-03-30 13:00:33 +00:00

6 lines
151 B
YAML

---
fixes:
- |
Fixed a potential race condition in the member batch update API call, the
load balancers might not have been locked properly.