[fix][broker] Avoid messages being repeatedly replayed with SHARED subscriptions (streaming dispatcher) - #17163
Conversation
eolivelli
left a comment
There was a problem hiding this comment.
good catch !
we need more eyes on this patch
@Technoboy- @codelipenghui @hangc0276 @merlimat @lhotari PTAL
|
@eolivelli thanks for the review. The |
|
I think we have to know the root cause. |
+1, we should handle this PR with extra care. It will filter out some messages, |
|
Hi, @nicoloboschi
I think it should be By the way, I want to collect some tests that need to move out of the flaky-test group... Because in the current time we may lose some test coverage. |
|
Thanks @mattisonchao I think we should point out the race condition or revert |
|
Thanks for the reviews @codelipenghui and @mattisonchao. Basically the case I'm seeing is the following:
After the recent work (see mentioned pull in the description) the methods The point 4. could be a problem and a new behaviour that will be introduced in 2.11. With this fix we prefer consistency (no duplicated sent to the consumers) over duplicated-reading. We read the same entry twice and perhaps we could optimize this edge-case in another pull. IMO still think this whole work of using different threads is worth. |
|
Hi, @nicoloboschi
I'm still wondering why invoking Controlled experiment: |
f16e157 to
ddabc6e
Compare
|
@mattisonchao nice catch!! you're right, that is the missing check Thanks, I've updated the pull with your suggestion |
|
I think we have to check the relative logic, to avoid another problem. Because I think this kind of logic is very important. |
mattisonchao
left a comment
There was a problem hiding this comment.
Could we move the test out of the flaky group to avoid regression?
eolivelli
left a comment
There was a problem hiding this comment.
I am sorry.
I misread the PR.
I thought we were in another class.
+1
Nice team work @nicoloboschi @mattisonchao
|
@Technoboy- this change must go into 2.11 as well |
…bscriptions (streaming dispatcher) (#17163) * [fix][broker] Avoid messages being repeatedly replayed with SHARED subscriptions * move test to broker-api
…bscriptions (streaming dispatcher) (apache#17163) * [fix][broker] Avoid messages being repeatedly replayed with SHARED subscriptions * move test to broker-api (cherry picked from commit 7f69727)




Motivation
There's a test failing constantly in the flaky suite:
#16795
While investigating, I found out a case when it's possible that the dispatcher replays twice the same message to the consumer. This may happens because the message's replay is async and it's done while reading entries.
I believe that it may be related to recent changes to the dispatcher:
StackOverFlowExceptionin SHARED subscription #16968Modifications
readMoreEntriesfor the streaming dispatcherThe proof that this fix works is that now the test
SimpleProducerConsumerTest.testSharedSamePriorityConsumerdoesn't fail anymore.Fix #16795
doc-not-needed