[fix][broker]Transactional messages can never be sent successfully if concurrently taking transaction buffer snapshot#24945
Merged
poorbarcode merged 12 commits intoapache:masterfrom Nov 11, 2025
Conversation
…currently executed transaction buffer snaoshot
Member
|
Checkstyle errors: Please run |
lhotari
reviewed
Nov 4, 2025
Member
|
test failures |
lhotari
reviewed
Nov 6, 2025
lhotari
reviewed
Nov 6, 2025
lhotari
reviewed
Nov 6, 2025
lhotari
reviewed
Nov 6, 2025
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #24945 +/- ##
=============================================
+ Coverage 38.56% 74.38% +35.82%
- Complexity 13262 33673 +20411
=============================================
Files 1856 1920 +64
Lines 145287 150138 +4851
Branches 16877 17414 +537
=============================================
+ Hits 56025 111687 +55662
+ Misses 81696 29570 -52126
- Partials 7566 8881 +1315
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
reviewed
Nov 7, 2025
Technoboy-
reviewed
Nov 7, 2025
Technoboy-
reviewed
Nov 7, 2025
BewareMyPower
approved these changes
Nov 10, 2025
Contributor
Technoboy-
approved these changes
Nov 11, 2025
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Nov 13, 2025
… concurrently taking transaction buffer snapshot (apache#24945) (cherry picked from commit f29ca21) (cherry picked from commit 85e8b5d)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Nov 14, 2025
… concurrently taking transaction buffer snapshot (apache#24945) (cherry picked from commit f29ca21) (cherry picked from commit 85e8b5d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Issue 1: concurrently initialising transaction buffer snapshot
Before #21406, the snapshot would be taken when the persistent topic is initialising, so no concurrency. After #21406, the transaction buffer snapshot is triggered by publishing messages, so concurrency occurs. #21406 forgot to handle this case, which caused the following errors
Issue 2: publishing messages before the transaction buffer is recovered.
Before #21406: a wrong variable was used when reconstructing the class, the correct variable should be
snapshotAbortedTxnProcessor, but it usedpublishFuture. See follows:This issue makes transaction buffer recovery and taking a transaction snapshot execute concurrently.
performance issue 3: the second write request can only be executed after the first response client
There is a variable named
publishFuture, the following publishing can only be executed after the previous one is done.https://github.com/apache/pulsar/pull/21406/files#diff-ecd728301a585f256e8a649b5e65b28c166194477355b3a1eefc198d014c25d3R255-R288
Modifications
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x