Skip to content
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

KAFKA-7236: Add --under-min-isr option to describe topics command (KIP-351) #6224

Merged
merged 5 commits into from
Feb 11, 2019

Conversation

KevinLiLu
Copy link
Contributor

@KevinLiLu KevinLiLu commented Feb 2, 2019

KIP-351

  • Add --under-min-isr option to TopicCommand to report partitions under the configured min.insync.replicas value

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@KevinLiLu
Copy link
Contributor Author

@viktorsomogyi @gwenshap can you give this a review? Thanks~

Copy link
Contributor

@vahidhashemian vahidhashemian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the KIP and the PR. Looks good to me overall. I left a few minor comments inline.

@@ -99,29 +99,37 @@ object TopicCommand extends Logging {
leader: Option[Int],
assignedReplicas: Seq[Int],
isr: Seq[Int],
minIsr: Int,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is just a count, I suggest using minIsrCount to avoid confusion with isr which is also a list of Int.

@@ -220,13 +228,16 @@ object TopicCommand extends Logging {
}
}
if (describeOptions.describePartitions) {
val computedMinIsr = if (opts.reportUnderMinIsrPartitions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here: configuredMinIsrCount?

@@ -536,6 +548,8 @@ object TopicCommand extends Logging {
"if set when describing topics, only show under replicated partitions")
private val reportUnavailablePartitionsOpt = parser.accepts("unavailable-partitions",
"if set when describing topics, only show partitions whose leader is not available")
private val reportUnderMinIsrPartitionsOpt = parser.accepts("under-minisr-partitions",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the KIP the config is proposed as under-min-isr-partitions. Is there a reason you used a different name? I think the name in the KIP (with a dash between min and isr) looks and reads better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@KevinLiLu
Copy link
Contributor Author

Hi @vahidhashemian, thanks for the review! I have added a commit addressing your comments.

I understand that the feature freeze for 2.2.0 was January 31st. Is this KIP bumped to the next release then, or can we still include this minor feature into 2.2.0?

Copy link
Contributor

@vahidhashemian vahidhashemian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the PR. I left a couple of minor nits that you can hopefully fix quickly. Then, I'll approve the PR, and merge once the trunk version is bumped.

Unfortunately, since the cutoff for 2.2 is passed this will be merged to trunk for the following release.

@@ -536,13 +536,78 @@ class TopicCommandWithAdminClientTest extends KafkaServerTestHarness with Loggin
killBroker(0)
val output = TestUtils.grabConsoleOutput(
topicService.describeTopic(new TopicCommandOptions(Array("--under-replicated-partitions"))))
println(output)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Unintentional println here?

* (4) topic with fully replicated partition
*
* Output should only display the (1) topic with partition under min ISR count and (3) topic with offline partition
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Please change references to three/3 to four/4 since there are 4 topics now.

Copy link
Contributor

@vahidhashemian vahidhashemian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR. LGTM.

Copy link
Contributor

@viktorsomogyi viktorsomogyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the PR, LGTM.

@viktorsomogyi
Copy link
Contributor

retest this please

1 similar comment
@KevinLiLu
Copy link
Contributor Author

retest this please

Copy link
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vahidhashemian vahidhashemian merged commit 3fb1d70 into apache:trunk Feb 11, 2019
@KevinLiLu
Copy link
Contributor Author

KevinLiLu commented Feb 11, 2019

Hi @vahidhashemian, thanks for the merge. I see that the trunk version was bumped up after this PR was merged. Did we squeeze this into 2.2.0 release, or is this still pushed back to 2.3.0?

@vahidhashemian
Copy link
Contributor

@KevinLiLu I believe this KIP was originally included in 2.2.0 release plan. So this PR should also be included since the feature freeze is this Friday. @mjsax could you please confirm? Thanks!

@mjsax
Copy link
Member

mjsax commented Feb 12, 2019

KIPs must be merged before feature freeze deadline (cf. https://cwiki.apache.org/confluence/display/KAFKA/Time+Based+Release+Plan) that was two week ago. Thus, this KIP slips for 2.2. Sorry.

It's already marked as postponed to 2.3 in https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=100827512

@KevinLiLu
Copy link
Contributor Author

@mjsax no worries, thanks for the clarification!

@vahidhashemian
Copy link
Contributor

Thanks for clarifying @mjsax.

pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…P-351) (apache#6224)

* KAFKA-7236: Add --under-min-isr option to describe topics command (KIP-351)

* Minor changes to description and make test consistent with others

* Fix option, and add additional test with mixed partition status

* Add fully-replicated-topic to test case

* Address review nits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants