Skip to content

KAFKA-9267: ZkSecurityMigrator should not create /controller node#7778

Closed
NanerLee wants to merge 2 commits into
apache:trunkfrom
NanerLee:fix-ZkSecurityMigrator
Closed

KAFKA-9267: ZkSecurityMigrator should not create /controller node#7778
NanerLee wants to merge 2 commits into
apache:trunkfrom
NanerLee:fix-ZkSecurityMigrator

Conversation

@NanerLee

@NanerLee NanerLee commented Dec 4, 2019

Copy link
Copy Markdown
Contributor

KAFKA-9267

ZkSecurityMigrator might create a PERSISTENT /controller node with null data, it will lead to controller can't elect.

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

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

@omkreddy omkreddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NanerLee Thanks for the PR. left a minor comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use simple if.. else block for this?

@NanerLee NanerLee force-pushed the fix-ZkSecurityMigrator branch from 84aaff9 to 3f9ca08 Compare December 5, 2019 04:06
@NanerLee

NanerLee commented Dec 5, 2019

Copy link
Copy Markdown
Contributor Author

@omkreddy Please review this patch again. Thanks.

@NanerLee NanerLee requested a review from omkreddy December 5, 2019 05:45

@omkreddy omkreddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NanerLee Thanks for the PR. LGTM.

zkClient.makeSurePersistentPathExists(path)
setAclsRecursively(path)
if (path == ControllerZNode.path && !zkClient.pathExists(path)) {
debug("Ignoring to set ACL for %s, because it doesn't exist".format(path))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we can use string-interpolation

Suggested change
debug("Ignoring to set ACL for %s, because it doesn't exist".format(path))
debug(s"Ignoring to set ACL for $path, because it doesn't exist")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right, but I just want to keep the code style.
Because other codes use the format() function.
Thanks.

@NanerLee

NanerLee commented Dec 6, 2019

Copy link
Copy Markdown
Contributor Author

retest this please.

@NanerLee

NanerLee commented Dec 6, 2019

Copy link
Copy Markdown
Contributor Author

@omkreddy Testes have been passed, do I have to do anything else?

@omkreddy omkreddy closed this in 8e12c3e Dec 6, 2019
@NanerLee NanerLee deleted the fix-ZkSecurityMigrator branch December 9, 2019 05:44
@NanerLee NanerLee restored the fix-ZkSecurityMigrator branch December 9, 2019 05:45
@NanerLee NanerLee deleted the fix-ZkSecurityMigrator branch December 9, 2019 05:52
gitlw pushed a commit to linkedin/kafka that referenced this pull request Jun 16, 2021
…create /controller node

[KAFKA-9267](https://issues.apache.org/jira/browse/KAFKA-9267)

ZkSecurityMigrator might create a PERSISTENT /controller node with null data, it will lead to controller can't elect.

*More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.*

*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*

Author: NanerLee <nanerlee@qq.com>

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>

Closes apache#7778 from NanerLee/fix-ZkSecurityMigrator
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.

2 participants