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][test] Fix flaky TransactionTest.testTakeSnapshotBeforeBuildTxnProducer by merlimat · Pull Request #27524 · apache/pulsar Conversation
Contributor
Problem
The test reads the private void takeSnapshotByTimeout() { if (changeMaxReadPositionCount.get() > 0) { takeSnapshot(); } this.timer.newTimeout(TopicTransactionBuffer.this, takeSnapshotIntervalTime, TimeUnit.MILLISECONDS); } When such a snapshot lands after the reader attaches and before the first check, A local run of the whole class reproduced the CI failure. When the method started, two leftover topics in
The broker is working as designed: topics in a namespace are expected to write their snapshots to the namespace's ExampleString topic = "persistent://" + NAMESPACE1 + "/testSnapShot"; ... Reader<TransactionBufferSnapshot> reader = pulsarClient .newReader(Schema.AVRO(TransactionBufferSnapshot.class)) .startMessageId(MessageId.latest) .topic(NAMESPACE1 + "/" + SystemTopicNames.TRANSACTION_BUFFER_SNAPSHOT) // shared by all of tnx/ns1 .create(); Awaitility.await().atMost(waitSnapShotTime * 2, TimeUnit.MILLISECONDS) // 4 s .untilAsserted(() -> Assert.assertFalse(reader.hasMessageAvailable())); // a leftover topic's snapshot // keeps this true ChangeTest only. The test creates a namespace of its own and reads that namespace's snapshot topic, which only its own // A namespace keeps the snapshots of all its topics in one system topic, and the topics that other methods // leave loaded in NAMESPACE1 keep taking periodic snapshots into it: read a namespace with only this topic. String namespace = TENANT + "/testTakeSnapshotBeforeBuildTxnProducer"; admin.namespaces().createNamespace(namespace); String topic = "persistent://" + namespace + "/testSnapShot"; ... .topic(namespace + "/" + SystemTopicNames.TRANSACTION_BUFFER_SNAPSHOT); The later checks also read only this topic's snapshots now: the first snapshot at entry -1, then the one at entry 3. Testing
The first retry annotation is from 5 Nov 23:34 UTC. #27376 (merged 5 Nov 21:06 UTC) stopped running a full GC after
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…roducer The test reads tnx/ns1's __transaction_buffer_snapshot topic from latest and expects nothing there until its own topic takes its first snapshot. Every transactional topic in the namespace writes its snapshots to that topic, and the topics that earlier methods leave loaded keep taking periodic ones (transactionBufferSnapshotMinTimeInMillis = 2 s) after a commit or an abort. One that lands after the reader attaches keeps hasMessageAvailable() true, so the 4 s await fails; the retry runs on fresh brokers and passes. Give the test a namespace of its own, so its reader only sees the snapshots of its own topic. …ke-snapshot-before-build-txn-producer
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
merlimat
deleted the
mmerli/fix-flaky-take-snapshot-before-build-txn-producer
branch
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…roducer (apache#27524) (cherry picked from commit 441e30e)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…roducer (apache#27524) (cherry picked from commit 441e30e)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |