Repository navigation
[fix][txn] Allow producer enable send timeout in transaction - #16519
Merged
codelipenghui merged 2 commits intoJul 11, 2022
Merged
codelipenghui merged 2 commits into
codelipenghui merged 2 commits into
Conversation
…nd_txn_message_timeout
codelipenghui
approved these changes
Jul 11, 2022
liangyepianzhou
approved these changes
Jul 11, 2022
|
@congbobo184 Please provide a correct documentation label for your PR. |
codelipenghui
pushed a commit
that referenced
this pull request
Jul 11, 2022
(cherry picked from commit bbf2a47)
codelipenghui
pushed a commit
that referenced
this pull request
Jul 11, 2022
(cherry picked from commit bbf2a47)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 11, 2022
Contributor
|
@codelipenghui There's a test failing on branch-2.10 related to this pull Could you verify ? |
Contributor
|
I found the reason, it's related to the test itself. Will send a fix soon |
1 task done
congbobo184
pushed a commit
that referenced
this pull request
Jul 14, 2022
…MessageTimeout (only release branches) (#16570) ### Motivation `TransactionEndToEndTest#testSendTxnMessageTimeout` fails on releases branch after #16519 has been cherry-picked. ``` java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.client.impl.TransactionEndToEndTest.testSendTxnMessageTimeout(TransactionEndToEndTest.java:1099) ``` The reason is that the mock setup must be slightly different since the `ProducerImpl` is not exactly the same between master and branch-2.10.
wuxuanqicn
pushed a commit
to wuxuanqicn/pulsar
that referenced
this pull request
Jul 14, 2022
mattisonchao
pushed a commit
that referenced
this pull request
Jul 15, 2022
…MessageTimeout (only release branches) (#16570) ### Motivation `TransactionEndToEndTest#testSendTxnMessageTimeout` fails on releases branch after #16519 has been cherry-picked. ``` java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.client.impl.TransactionEndToEndTest.testSendTxnMessageTimeout(TransactionEndToEndTest.java:1099) ``` The reason is that the mock setup must be slightly different since the `ProducerImpl` is not exactly the same between master and branch-2.10.
nicoloboschi
added a commit
to datastax/pulsar
that referenced
this pull request
Jul 15, 2022
…MessageTimeout (only release branches) (apache#16570) ### Motivation `TransactionEndToEndTest#testSendTxnMessageTimeout` fails on releases branch after apache#16519 has been cherry-picked. ``` java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.client.impl.TransactionEndToEndTest.testSendTxnMessageTimeout(TransactionEndToEndTest.java:1099) ``` The reason is that the mock setup must be slightly different since the `ProducerImpl` is not exactly the same between master and branch-2.10. (cherry picked from commit c83bede)
nicoloboschi
added a commit
to datastax/pulsar
that referenced
this pull request
Jul 18, 2022
…MessageTimeout (only release branches) (apache#16570) ### Motivation `TransactionEndToEndTest#testSendTxnMessageTimeout` fails on releases branch after apache#16519 has been cherry-picked. ``` java.lang.AssertionError: expected [true] but found [false] at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.client.impl.TransactionEndToEndTest.testSendTxnMessageTimeout(TransactionEndToEndTest.java:1099) ``` The reason is that the mock setup must be slightly different since the `ProducerImpl` is not exactly the same between master and branch-2.10. (cherry picked from commit c83bede)
lhotari
added a commit
to lhotari/pulsar
that referenced
this pull request
Sep 7, 2026
…ands Follow-up to the review on apache#26480, pulsar-perf half. - `transaction-v4` had no functional coverage: every existing reference was metadata-only, so the transaction binding itself was unpinned. Adds `PerformanceTransactionV4Test` with a commit run and an `-abort` run against plain `persistent://` topics. The commit run asserts both halves are durable (produced messages visible, consume backlog down by one per transaction); the abort run asserts neither is (nothing visible, backlog unchanged, and all ten messages redeliverable on the tool's own subscription, which is what separates a real abort from a transaction that was merely never ended). Mutation checked: making `sendMessage` or `acknowledgeAsync` ignore the transaction, dropping the acknowledgement entirely, or making `abortTransaction` a no-op each fail it. - `PerformanceConsumerBase` had dropped the `consumerType` attribute from the per-topic "Adding consumers" line, which the pre-split `PerformanceConsumer` logged. Restores it through a `consumerTypeForLog()` hook: the base reports the shared `--subscription-type`, `PerformanceConsumer` overrides it with `scalableConsumerType`, so the V5 line matches the pre-split output again. - `PerformanceTransactionBase` interrupted `Thread.currentThread()` from its failure callbacks. That is the worker thread for a V5 ack, whose future is already complete when returned, but a client-internal thread for a v4 ack and for the send and end-transaction futures on both clients. All three callbacks now capture the worker thread, which is the thread `runWorker` invokes them on. - `transaction-v4`'s and `produce-v4`'s `sendTimeout(0)` was annotated "a send timeout and a transaction are mutually exclusive on the v4 client". That guard was removed in apache#16519; the setting is still right because a send timeout fails the send on its own schedule and takes the transaction with it, so the comments now say that instead. - `PerformanceV4CommandsTest`: the backlog assertion now waits with Awaitility (the exit latch is released before the client close that flushes the acks, and the 30s join is unchecked), and the delivery-time assertions also pin each message's payload so a future reordering fails legibly. - The `LATENCY_HISTOGRAM_SIGNIFICANT_DIGITS` rationale still described the static recorders that apache#26466 replaced with instance fields in the same commit that added the comment. Rewords both copies, with the figure re-measured on HdrHistogram 2.2.2: 16.00 MB (1h in micros) and 14.00 MB (10d in millis) at 5 digits, not the pre-apache#26466 ranges' 11-22 MB.
2 of 14 tasks
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
In the actual scenario, because the transaction will timeout, the transaction cannot block sending messages all the time. So we send messages with txn need to throw TimeoutException
Modifications
send messages with txn don't need set producer config
.sendTimeout(0, TimeUnit.SECONDS)Verifying this change
add send messages with txn throw TimeoutException test
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
Does this pull request introduces a new feature? (yes)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
If a feature is not applicable for documentation, explain why?
If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
doc-not-needed