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

CURATOR-489: CreateBuilderImpl assigns protectedId if doProtected is … #284

Merged
merged 4 commits into from Dec 5, 2018

Conversation

joshng
Copy link
Contributor

@joshng joshng commented Dec 4, 2018

This is a light change to correct a bug when doProtected is true: the existing code sets CreateBuilderImpl.doProtected = true, but assigns protectedId = null, resulting in a non-unique protection-token (_c_null-) being applied to the name created in zookeeper. Given that all replicas coordinating via zookeeper would use the identical token, this could conceivably lead to incorrect behavior when the protection logic is needed.

While I believe this PR fixes the bug, I'd really suggest a more comprehensive change to eliminate the CreateBuilderImpl.doProtected field entirely, instead relying upon protectedId != null to convey this intention. However, being unfamiliar with the nuances of the existing implementation, I didn't want to perform that surgery today. If you think that change seems preferable, I'd be happy to do that instead.

@Randgalt
Copy link
Member

Randgalt commented Dec 4, 2018

suggest a more comprehensive change to eliminate the CreateBuilderImpl.doProtected field entirely

Maybe a separate issue for that.

Do you mind writing a test for this please?

@Randgalt
Copy link
Member

Randgalt commented Dec 5, 2018

Actually - I just opened a PR on your repo with a test

@joshng
Copy link
Contributor Author

joshng commented Dec 5, 2018

Ok, that test is incorporated here now. 👍

@asfgit asfgit merged commit 1720520 into apache:master Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants