-
Notifications
You must be signed in to change notification settings - Fork 962
replication stat num-under-replicated-ledgers changed as with the pro… #2805
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
replication stat num-under-replicated-ledgers changed as with the pro… #2805
Conversation
|
@eolivelli PTAL |
nicoloboschi
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.
LGTM, minor comments here
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
Outdated
Show resolved
Hide resolved
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
Outdated
Show resolved
Hide resolved
|
@nicoloboschi PTAL |
nicoloboschi
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.
+1
dlg99
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.
I am not convinced that it solves the problem as you outlined it (see my comment on the review) + the PR needs a unit test.
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
Outdated
Show resolved
Hide resolved
431f26f to
7d985c8
Compare
fyi: https://bookkeeper.apache.org/community/coding_guide/ and https://bookkeeper.apache.org/community/contributing/#optional-ide-setup for checkstyle configuration |
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
Show resolved
Hide resolved
fc639a2 to
11d6119
Compare
…cess of replication
6f4ee21 to
7f0b333
Compare
|
@eolivelli PTAL again, It has been for a lone time |
|
@zymap PTAL |
|
rerun failure checks |
…cess of replication Motivation Now ReplicationStats numUnderReplicatedLedger registers when `publishSuspectedLedgersAsync`, but its value doesn't decrease as with the ledger replicated successfully, We cannot know the progress of replication from the stat. Changes registers a notifyUnderReplicationLedgerChanged when auditor starts. numUnderReplicatedLedger value will decrease when the ledger path under replicate deleted. Reviewers: Nicolò Boschi <boschi1997@gmail.com>, Enrico Olivelli <eolivelli@gmail.com>, Andrey Yegorov <None> This closes apache#2805 from gaozhangmin/replication-stats-num-under-replicated-ledgers
hangc0276
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.
-1 for this change
| } | ||
| }; | ||
| try { | ||
| zkc.addWatch(urLedgerPath, w, AddWatchMode.PERSISTENT_RECURSIVE); |
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.
It will register a lot of watcher on Zookeeper
| public void operationComplete(int rc, Void result) { | ||
| Iterator<UnderreplicatedLedger> underreplicatedLedgersInfo = ledgerUnderreplicationManager | ||
| .listLedgersToRereplicate(null); | ||
| underReplicatedLedgersGuageValue.set(Iterators.size(underreplicatedLedgersInfo)); |
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.
The Iterators.size will iterate the whole Znodes in an under-replicated path which brings heavy pressure on Zookeeper and lead to dead lock.
Agree, I think we can revert it. |
|
This PR introduced a deadlock described: apache/pulsar#21010 |
…cess of replication Motivation Now ReplicationStats numUnderReplicatedLedger registers when `publishSuspectedLedgersAsync`, but its value doesn't decrease as with the ledger replicated successfully, We cannot know the progress of replication from the stat. Changes registers a notifyUnderReplicationLedgerChanged when auditor starts. numUnderReplicatedLedger value will decrease when the ledger path under replicate deleted. Reviewers: Nicolò Boschi <boschi1997@gmail.com>, Enrico Olivelli <eolivelli@gmail.com>, Andrey Yegorov <None> This closes apache#2805 from gaozhangmin/replication-stats-num-under-replicated-ledgers
Motivation
Now ReplicationStats numUnderReplicatedLedger registers when
publishSuspectedLedgersAsync, but its value doesn't decrease as with the ledger replicated successfully, We cannot know the progress of replication from the stat.Changes
registers a notifyUnderReplicationLedgerChanged when auditor starts. numUnderReplicatedLedger value will decrease when the ledger path under replicate deleted.