Skip to content

[fix][client] Consumer lost message ack due to race condition in acknowledge with batch message#22353

Merged
lhotari merged 8 commits intoapache:masterfrom
Shawyeok:fix/message-ack-lost
Mar 27, 2024
Merged

[fix][client] Consumer lost message ack due to race condition in acknowledge with batch message#22353
lhotari merged 8 commits intoapache:masterfrom
Shawyeok:fix/message-ack-lost

Conversation

@Shawyeok
Copy link
Copy Markdown
Contributor

@Shawyeok Shawyeok commented Mar 26, 2024

Motivation

Fixes #22352

Modifications

Add synchronize protection on bitset operations acknowledge with batch message

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added unit test for MessageIdAdvUtilsTest#acknowledge in multi-thread scenario

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: Shawyeok#15

BewareMyPower
BewareMyPower previously approved these changes Mar 26, 2024
Copy link
Copy Markdown
Contributor

@BewareMyPower BewareMyPower left a comment

Choose a reason for hiding this comment

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

It would be better to update the API documentation as well. We must note that any read or modification on the return value of MessageIdAdv#getAckSet() should be synchronized on the lock as well.

@BewareMyPower BewareMyPower dismissed their stale review March 26, 2024 09:58

It should be comments rather than approved

Comment thread pulsar-common/src/main/java/org/apache/pulsar/client/api/MessageIdAdv.java Outdated
…geIdAdv.java

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

I have some questions about the test case.

Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Good work @Shawyeok

@Shawyeok
Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@lhotari lhotari added the type/bug The PR fixed a bug or issue reported a bug label Mar 27, 2024
@lhotari lhotari merged commit 3fa2ae8 into apache:master Mar 27, 2024
@Shawyeok
Copy link
Copy Markdown
Contributor Author

Thank you for review and suggestions. @lhotari @BewareMyPower @poorbarcode

lhotari pushed a commit that referenced this pull request Mar 27, 2024
…owledge with batch message (#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
lhotari pushed a commit that referenced this pull request Mar 27, 2024
…owledge with batch message (#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
@Shawyeok Shawyeok deleted the fix/message-ack-lost branch March 28, 2024 07:43
@Technoboy- Technoboy- added this to the 3.3.0 milestone Apr 1, 2024
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Apr 1, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
(cherry picked from commit 9c50d18)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
(cherry picked from commit 9c50d18)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
(cherry picked from commit 9c50d18)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
(cherry picked from commit 9c50d18)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
(cherry picked from commit 3fa2ae8)
(cherry picked from commit 9c50d18)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
…owledge with batch message (apache#22353)

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Co-authored-by: 汪苏诚 <sucheng.wang@zhaopin.com.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Client] Consumer lost message ack due to race condition in acknowledge with batch message

5 participants