KAFKA-5135: Controller Health Metrics (KIP-143)#2983
KAFKA-5135: Controller Health Metrics (KIP-143)#2983ijuma wants to merge 17 commits intoapache:trunkfrom
Conversation
|
This is an initial PR to get some feedback on whether I'm on the right track. Need to write tests and verify if any additional work needs to be done to clean-up metrics. cc @onurkaraman @junrao |
There was a problem hiding this comment.
This is a concurrency bug. You should be synchronizing access to brokerStateInfo.
There was a problem hiding this comment.
The ElectingLeader state seems somewhat out of place. Should this reflect that a broker change event is occurring?
There was a problem hiding this comment.
The KIP says BrokerChange indeed. However, we have LeaderElectionRateAndTimeMs that seems to measure the same code path. So, I thought it would make sense to use a similar name.
There was a problem hiding this comment.
The BrokerTopicStats refactoring causes the PR to be much larger than I think it needs to be. Can we move this change out into a separate cleanup PR?
There was a problem hiding this comment.
The changes are mechanical, the diffstat is +483 −315 (which is manageable) and there's a separate commit for the refactoring. So, I think we don't need a separate PR. Let's see what @junrao says.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
@ijuma : Thanks for the patch. The general approach looks good. |
bcc18df to
0217270
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
0217270 to
59267fb
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
59267fb to
c8cfd2f
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
c8cfd2f to
d467ca4
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
d467ca4 to
6227f86
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
6227f86 to
35bc136
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
7dc99cd to
0e2df6a
Compare
We don’t use any functionality from `AtomicInteger`, we simply set and read values.
…at need it Reducing exposure of fields from KafkaController reduces coupling.
|
Refer to this link for build results (access rights to CI server needed): |
|
Thanks for the review @junrao. I addressed your feedback. Also, while removing the |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
| EasyMock.expect(eventMock.process()).andAnswer(new IAnswer[Unit]() { | ||
| def answer(): Unit = { | ||
| while (processing) | ||
| Thread.`yield`() |
There was a problem hiding this comment.
Since the behavior of Thread.yield() can be platform dependent, would it be better to change processing to sth like a CountDownLatch()?
There was a problem hiding this comment.
That's a good suggestion. Both are correct (even if Thread.yield is a no-op, it won't matter here), but CountDownLatch is more concise and shows intent better. Updated the PR.
e2a1dc7 to
99fb9a1
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
@ijuma : Thanks for the patch. LGTM. I will let you merge this when the tests complete. |
|
Refer to this link for build results (access rights to CI server needed): |
Author: Ismael Juma <ismael@juma.me.uk> Reviewers: Jun Rao <junrao@gmail.com>, Onur Karaman <okaraman@linkedin.com> Closes #2983 from ijuma/kafka-5135-controller-health-metrics-kip-143 (cherry picked from commit 516d845) Signed-off-by: Ismael Juma <ismael@juma.me.uk>
No description provided.