[fix][txn] Fix getting last message ID when there are ongoing transactions#21466
[fix][txn] Fix getting last message ID when there are ongoing transactions#21466coderzc merged 11 commits intoapache:masterfrom
Conversation
1c19f30 to
92fdf29
Compare
|
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
129fecf to
64412a0
Compare
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
…on` to TransactionBufferDisable
Codecov ReportAttention: Patch coverage is
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.
🚀 New features to boost your workflow:
|
…tions (apache#21466) (cherry picked from commit 99cab24)
…tions (apache#21466) (cherry picked from commit 99cab24)
Motivation
getLastMessageIdsshould 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
MaxReadPositionof the topic is unknown. Wait it recovers completely is needed.MaxReadPositionshould be the previous position of the first ongoing transaction position instead ofEntryID -1. Because compacted decide whether the topic's managedLedger is null byEntryID == -1pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Lines 2161 to 2176 in 2322004
Modifications
max read positionwhen callinggetLastMessageIds.checkIfTBRecoverCompletelybefore getting the max read position.Unknownerror 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
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: