Skip to content

rabbit_db_exchange: Always use a transaction to bump exchange serials (backport #15236)#15238

Merged
dumbbell merged 1 commit intov4.2.xfrom
mergify/bp/v4.2.x/pr-15236
Jan 9, 2026
Merged

rabbit_db_exchange: Always use a transaction to bump exchange serials (backport #15236)#15238
dumbbell merged 1 commit intov4.2.xfrom
mergify/bp/v4.2.x/pr-15236

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Jan 9, 2026

Why

Initially, I thought a transaction would be too much for a simple counter. Therefore I use a regular get, plus a put with a condition on the tree node payload version to ensure the put would only succeed of the read value was still the one in the store.

Unfortunately this technic is very inefficient with a lot of concurrency. That's because all processes will read the same value and will all commit a put, but only one of them will succeed. After that, all but on will retry the same read/modify/write with the same poor result. In the end, all processes are spamming put commands and they make very little progress, loading the store in the process.

How

This patch goes back to a simple transaction. This solves the contention issue.


This is an automatic backport of pull request #15236 done by Mergify.

[Why]
Initially, I thought a transaction would be too much for a simple
counter. Therefore I use a regular `get`, plus a `put` with a condition
on the tree node payload version to ensure the put would only succeed of
the read value was still the one in the store.

Unfortunately this technic is very inefficient with a lot of
concurrency. That's because all processes will read the same value and
will all commit a `put`, but only one of them will succeed. After that,
all but on will retry the same read/modify/write with the same poor
result. In the end, all processes are spamming `put` commands and they
make very little progress, loading the store in the process.

[How]
This patch goes back to a simple transaction. This solves the contention
issue.

(cherry picked from commit 66abb3a)
@dumbbell dumbbell marked this pull request as draft January 9, 2026 12:08
@dumbbell dumbbell marked this pull request as ready for review January 9, 2026 15:33
@dumbbell dumbbell merged commit c6f233c into v4.2.x Jan 9, 2026
575 of 577 checks passed
@dumbbell dumbbell deleted the mergify/bp/v4.2.x/pr-15236 branch January 9, 2026 15:33
@dumbbell dumbbell added this to the 4.2.3 milestone Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant