pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

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

Open poorbarcode opened this issue 1 year ago • 1 comments

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
  • [x] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: x

poorbarcode avatar Feb 04 '24 06:02 poorbarcode

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 avatar Feb 04 '24 16:02 poorbarcode

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (fce0717) 72.90% compared to head (bd9869c) 73.56%. Report is 21 commits behind head on master.

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%) :arrow_down:

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

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

... and 202 files with indirect coverage changes

codecov-commenter avatar Feb 18 '24 14:02 codecov-commenter