-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][ml] Negative backlog & acked positions does not exist & message lost when concurrently occupying topic owner #24722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@poorbarcode Please add the following content to your PR description and select a checkbox: |
|
/pulsarbot rerun-failure-checks |
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
|
@poorbarcode Regarding the title "Negative backlog & acked positions does not exist & message lost when concurrently occupying topic owner" is describing the current symptoms and impact. Perhaps it should be emphasized in the title that this PR is addressing fundamentals of how Pulsar Brokers should be handling topic ownership? It's surprising that this hasn't already been implemented properly by now. Thanks for addressing this issue! |
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some questions and comments.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #24722 +/- ##
============================================
+ Coverage 74.16% 74.24% +0.08%
- Complexity 33498 33636 +138
============================================
Files 1896 1900 +4
Lines 148109 148420 +311
Branches 17163 17211 +48
============================================
+ Hits 109844 110199 +355
+ Misses 29488 29453 -35
+ Partials 8777 8768 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the review comments.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java
Show resolved
Hide resolved
… lost when concurrently occupying topic owner (apache#24722) (cherry picked from commit e417aca) (cherry picked from commit ec9039d)
… lost when concurrently occupying topic owner (apache#24722) (cherry picked from commit e417aca) (cherry picked from commit ec9039d)
… lost when concurrently occupying topic owner (apache#24722)
… lost when concurrently occupying topic owner (apache#24722)
Motivation
Our pulsar cluster encountered an issue where the response of the command
pulsar-admin topics stats --get-precise-backlog --get-subscription-backlog-size <topic>has a negative backlog.And topic internal stats show that a consumer acknowledged messages that do not exist in
topic.ledgers{"ledgerId":1140377,"entries":5,"size":45573,"offloaded":false,"metadata":null,"underReplicated":false}(1140377:-1..1140377:6]The issue happened this way:
managedLedgerDefaultEnsembleSize=2managedLedgerDefaultWriteQuorum=2managedLedgerDefaultAckQuorum=2ledgers:[3: {entries: 1}]bookie-2is slowbroker-1broker-2bookie-1bookie-23:1(has not completed yet)3:13:1broker-13:2(has not sent to Bookies yet)33333:23:2fenced errorsince the ledger has been closedfenced error4and write topic metadata with[3: {entries: 1}]sincebookie-2has not responded to the request of writing3:1broker-1for the writing3:133, and it has2entries3:1Highlight: The issue also leads to messages being lost.
You can reproduce the issue with the new test
testConcurrentlyCloseCurrentLedgerModifications
Re-check the ledger entries from the metadata store if received a
fenced errorwhen writing BookiesDocumentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x