Skip to content

Conversation

@RobertIndie
Copy link
Member

@RobertIndie RobertIndie commented Sep 2, 2022

Fixes #17011

Motivation

for (int i = 0; i < totalProducedMsgs; i++) {
Message<?> msg = consumer.receive(500, TimeUnit.MILLISECONDS);
if (msg == null) {
break;
}
receivedMsgs.add(new String(msg.getData()));
}
// there is no guarantee when a messages is acknowledged when consumer.acknowledge is called.
// consumer.acknowledge only guarantees that an ack request is sent to the wire. so we can
// only check all unackMsgs will be redelivered.
unackMsgs.forEach(msg -> assertTrue(receivedMsgs.contains(msg)));

From the test, we can observe that the consumer can receive the full number of messages, but the received messages are not complete. There may be duplicate messages in the topic, and we need to enable the deduplication.

Modifications

Enable the broker deduplication for the PersistentStreamingDispatcherBlockConsumerTest.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

…Test.testBrokerSubscriptionRecovery

Enable the broker deduplication for the PersistentStreamingDispatcherBlockConsumerTest.

Signed-off-by: Zike Yang <zike@apache.org>
@RobertIndie RobertIndie added type/bug The PR fixed a bug or issue reported a bug type/flaky-tests labels Sep 2, 2022
@RobertIndie RobertIndie added this to the 2.12.0 milestone Sep 2, 2022
@RobertIndie RobertIndie self-assigned this Sep 2, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

@RobertIndie Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@RobertIndie RobertIndie added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 2, 2022
Copy link
Contributor

@poorbarcode poorbarcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found another problem:

  • Messages are received out of order. see #17418

@RobertIndie RobertIndie marked this pull request as draft September 5, 2022 03:16
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

The pr had no activity for 30 days, mark with Stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs Stale type/bug The PR fixed a bug or issue reported a bug type/flaky-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky-test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerSubscriptionRecovery

2 participants