Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Jul 26, 2022

Fixes #16802

Motivation

We should not run sendMessagesToConsumers in a separated thread. If the execute order is

readMoreEntries (1st) -> readEntriesComplete (1st) -> readMoreEntries (2nd) -> sendMessagesToConsumers (1st)

The replay queue would be read repeatedly.

Modifications

Revert #16603.

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)

… (per-subscription) thread (dispatcherDispatchMessagesInSubscriptionThread) (apache#16603)"

Fixes apache#16802

This reverts commit abe5d15.
@BewareMyPower BewareMyPower added type/bug The PR fixed a bug or issue reported a bug release/blocker Indicate the PR or issue that should block the release until it gets resolved labels Jul 26, 2022
@BewareMyPower BewareMyPower added this to the 2.11.0 milestone Jul 26, 2022
@BewareMyPower BewareMyPower self-assigned this Jul 26, 2022
@eolivelli
Copy link
Contributor

Instead of reverting, can we change the default to false?
I will look deeper into the problem

@BewareMyPower
Copy link
Contributor Author

@eolivelli Just have a private discussion with @mattisonchao, he also suggested only changing the default value.

However, IMO, keeping this option could still bring some potential risks. We have to note that if you're enabling this option, duplicated messages might be received. At the time, there is something wrong with this implementation. I think we should revert the implementation and only add it again after fixing the bug.

@codelipenghui
Copy link
Contributor

@eolivelli I think we can change to false first and you can continue to check the details of this issue. If the issue cannot be resolved before the 2.11.0 release, we should revert this one. Because after users enable this option, they will get duplicated messages.

@BewareMyPower Could you please open a separate PR to change the default value to false? Just keep this one to track if we need revert or not.

@mattisonchao
Copy link
Member

@eolivelli Just have a private discussion with @mattisonchao, he also suggested only changing the default value.

However, IMO, keeping this option could still bring some potential risks. We have to note that if you're enabling this option, duplicated messages might be received. At the time, there is something wrong with this implementation. I think we should revert the implementation and only add it again after fixing the bug.

@BewareMyPower
Yes, I change my mind. After a deep look at this PR, I realise revert is better than changing it to false because this PR involved an issue and was originally just a performance issue.

Hi, @eolivelli
Could you provide a fix at the release 2.11 period? If not, we can revert this PR before release 2.11.

@BewareMyPower
Copy link
Contributor Author

I agree. Let's keep this PR open and I'll push another PR to disable the option.

BewareMyPower added a commit to BewareMyPower/pulsar that referenced this pull request Jul 27, 2022
### Motivation

See apache#16802 and the discussion in
apache#16803. Before reverting apache#16603,
disabling the `dispatcherDispatchMessagesInSubscriptionThread` option
first.

### Modifications

Change the default value of
`dispatcherDispatchMessagesInSubscriptionThread` to false.
@eolivelli
Copy link
Contributor

@mattisonchao @BewareMyPower @codelipenghui
I am investigating on the problem today

@BewareMyPower
Copy link
Contributor Author

Close it due to #16812

@BewareMyPower BewareMyPower deleted the bewaremypower/revert-16603 branch July 27, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/blocker Indicate the PR or issue that should block the release until it gets resolved type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated messages of shared dispatcher

4 participants