-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][txn] Fix getting last message ID when there are ongoing transactions #21466
Conversation
1c19f30
to
92fdf29
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/apache/pulsar/broker/transaction/buffer/TopicTransactionBufferTest.java
Show resolved
Hide resolved
Could you please help review
I'm not sure what does it actually means. |
I think this change is correct since the first entryID of ongoing maybe 0, so its previous entry can't be directly by entryID-1. |
@liangyepianzhou I think this PR also fixes #21456. |
Modification: 1. Wait transaction buffer ready 2. Use `getPreviousPosition` replace `EntryID - 1`
7a4d0c8
to
1606f20
Compare
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
129fecf
to
64412a0
Compare
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
…on` to TransactionBufferDisable
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #21466 +/- ##
=============================================
+ Coverage 31.82% 73.37% +41.55%
- Complexity 11870 32661 +20791
=============================================
Files 1511 1893 +382
Lines 116133 140721 +24588
Branches 12585 15502 +2917
=============================================
+ Hits 36963 103260 +66297
+ Misses 74228 29344 -44884
- Partials 4942 8117 +3175
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…tions (apache#21466) (cherry picked from commit 99cab24)
…tions (apache#21466) (cherry picked from commit 99cab24)
Motivation
getLastMessageIds
should return the max read position instead oflastConfirmedEntry
.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Lines 2117 to 2122 in 2322004
MaxReadPosition
of the topic is unknown. Wait it recovers completely is needed.MaxReadPosition
should be the previous position of the first ongoing transaction position instead ofEntryID -1
. Because compacted decide whether the topic's managedLedger is null byEntryID == -1
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Lines 2161 to 2176 in 2322004
Modifications
max read position
when callinggetLastMessageIds
.checkIfTBRecoverCompletely
before getting the max read position.Unknown
error to the client.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: