GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [fix][txn] Fix getting last message ID when there are ongoing transactions by liangyepianzhou · Pull Request #21466 · apache/pulsar Conversation
|
| if (consumerFuture != null && consumerFuture.isDone() && !consumerFuture.isCompletedExceptionally()) { | |
| Consumer consumer = consumerFuture.getNow(null); | |
| long requestId = getLastMessageId.getRequestId(); | |
| Topic topic = consumer.getSubscription().getTopic(); | |
| Position lastPosition = topic.getLastPosition(); |
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 of EntryID -1. Because compacted decide whether the topic's managedLedger is null by EntryID == -1pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Lines 2161 to 2176 in 2322004
| compactionHorizonFuture.whenComplete((compactionHorizon, ex) -> { | |
| if (ex != null) { | |
| log.error("Failed to get compactionHorizon.", ex); | |
| writeAndFlush(Commands.newError(requestId, ServerError.MetadataError, ex.getMessage())); | |
| return; | |
| } | |
| if (lastPosition.getEntryId() == -1 || (compactionHorizon != null | |
| && lastPosition.compareTo((PositionImpl) compactionHorizon) <= 0)) { | |
| handleLastMessageIdFromCompactionService(persistentTopic, requestId, partitionIndex, | |
| markDeletePosition); | |
| return; | |
| } | |
| // For a valid position, we read the entry out and parse the batch size from its metadata. | |
| CompletableFuture<Entry> entryFuture = new CompletableFuture<>(); |
max read position when calling getLastMessageIds.checkIfTBRecoverCompletely before getting the max read position.Unknown error to the client.(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:)
If the box was checked, please highlight the changes
doc doc-required doc-not-needed doc-complete PR in forked repository:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1c19f30 to
92fdf29
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Could you please help review
I'm not sure what does it actually means. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@liangyepianzhou I think this PR also fixes #21456. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Modification: 1. Wait transaction buffer ready 2. Use `getPreviousPosition` replace `EntryID - 1`
7a4d0c8 to
1606f20
Compare
There was an error while loading. Please reload this page.
129fecf to
64412a0
Compare
|
/pulsarbot run-failure-checks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/pulsarbot run-failure-checks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…on` to TransactionBufferDisable
There was an error while loading. Please reload this page.
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:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…tions (apache#21466) (cherry picked from commit 99cab24)
…tions (apache#21466) (cherry picked from commit 99cab24)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.