Skip to content

[fix] [broker] Subscription stuck due to called Admin API analyzeSubscriptionBacklog#22019

Merged
dao-jun merged 12 commits into
apache:masterfrom
poorbarcode:fix/stuck_by_analyzeSubscriptionBacklog
Feb 18, 2024
Merged

[fix] [broker] Subscription stuck due to called Admin API analyzeSubscriptionBacklog#22019
dao-jun merged 12 commits into
apache:masterfrom
poorbarcode:fix/stuck_by_analyzeSubscriptionBacklog

Conversation

@poorbarcode

@poorbarcode poorbarcode commented Feb 4, 2024

Copy link
Copy Markdown
Contributor

Motivation

The Admin API analyzeSubscriptionBacklog will create an OpReadEntry and trigger a read, which leads Managecursor.readPosition to move forward. It makes the subscription stuck(just like the consumer receives messages but does not acknowledge them).

Modifications

  • Substitute new non-durable cursor for subscription.cursor
  • Rename the param startCursorPosition of new NonDurableCursor to mdPosition, make the code more clearer

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Feb 4, 2024
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Feb 4, 2024
@poorbarcode poorbarcode added release/3.0.3 release/2.11.4 release/3.1.3 release/3.2.1 type/bug The PR fixed a bug or issue reported a bug category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost labels Feb 4, 2024
@poorbarcode poorbarcode added this to the 3.3.0 milestone Feb 4, 2024
@poorbarcode poorbarcode closed this Feb 4, 2024
@poorbarcode poorbarcode reopened this Feb 4, 2024
Comment thread managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpScan.java Outdated
@poorbarcode
poorbarcode requested a review from gaoran10 February 4, 2024 13:28
Comment thread managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java Outdated
@poorbarcode

poorbarcode commented Feb 4, 2024

Copy link
Copy Markdown
Contributor Author

A new update: The new Non-Durable cursor has not copied the ack state when creating, I will fix it tomorrow.

New update(2024-02-05): fixed

@poorbarcode
poorbarcode requested review from Technoboy- and codelipenghui and removed request for codelipenghui February 5, 2024 02:13
@codecov-commenter

codecov-commenter commented Feb 18, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 64.70588% with 12 lines in your changes missing coverage. Please review.

Project coverage is 73.56%. Comparing base (fce0717) to head (bd9869c).
Report is 1255 commits behind head on master.

Files with missing lines Patch % Lines
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 62.50% 4 Missing and 2 partials ⚠️
...ker/service/persistent/PersistentSubscription.java 70.58% 5 Missing ⚠️
...lsar/common/util/collections/BitSetRecyclable.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22019      +/-   ##
============================================
+ Coverage     72.90%   73.56%   +0.66%     
- Complexity    32464    32559      +95     
============================================
  Files          1850     1874      +24     
  Lines        138611   139253     +642     
  Branches      15201    15263      +62     
============================================
+ Hits         101052   102444    +1392     
+ Misses        29711    28888     -823     
- Partials       7848     7921      +73     
Flag Coverage Δ
inttests 24.63% <0.00%> (?)
systests 24.32% <0.00%> (?)
unittests 72.85% <64.70%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lsar/common/util/collections/BitSetRecyclable.java 46.01% <0.00%> (-0.13%) ⬇️
...ker/service/persistent/PersistentSubscription.java 76.54% <70.58%> (-0.37%) ⬇️
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 78.84% <62.50%> (-0.61%) ⬇️

... and 202 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dao-jun
dao-jun merged commit 825e997 into apache:master Feb 18, 2024
Technoboy- pushed a commit that referenced this pull request Feb 20, 2024
Technoboy- pushed a commit that referenced this pull request Feb 22, 2024
Technoboy- pushed a commit that referenced this pull request Feb 27, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/reliability The function does not work properly in certain specific environments or failures. e.g. data lost cherry-picked/branch-3.0 cherry-picked/branch-3.1 cherry-picked/branch-3.2 doc-not-needed Your PR changes do not impact docs ready-to-test release/2.11.5 release/3.0.3 release/3.1.3 release/3.2.1 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.

8 participants