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

fix(3525): SET should only affect statements after it #3529

Merged

Conversation

big-andy-coates
Copy link
Contributor

Description

Fixes #3525

This commit fixes a regression that sees an old issue reappearing where by a SET statement affects not just statements that follow it, but also statements before it. The primary cause of this is the fact that ConfiguredStatement contains a reference to a mutable map containing the property overrides. This map is mutated by subsequent SET statements. The fix is to make for ConfiguredStatement to take a immutable defensive copy, as is good programming practice. This involves adding explicit handling of SET and UNSET statements, which can no long mutate the overrides in ConfiguredStatement.

Testing done

usual

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

Fixes confluentinc#3525

This commit fixes a regression that sees an old issue reappearing where by a SET statement affects not just statements that follow it, but also statements before it. The primary cause of this is the fact that `ConfiguredStatement` contains a reference to a mutable map containing the property overrides. This map is mutated by subsequent SET statements.  The fix is to make for `ConfiguredStatement` to take a immutable defensive copy, as is good programming practice.  This involves adding explicit handling of SET and UNSET statements, which can no long mutate the overrides in `ConfiguredStatement`.
@big-andy-coates big-andy-coates requested a review from a team as a code owner October 10, 2019 16:44
@vcrfxia vcrfxia changed the title fix(3525): sET should only affect statements after it fix(3525): SET should only affect statements after it Oct 10, 2019
Copy link
Contributor

@vcrfxia vcrfxia left a comment

Choose a reason for hiding this comment

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

Thanks @big-andy-coates -- LGTM. Do you know when this regression was introduced? (Does this fix need to be back-ported?)

@vcrfxia vcrfxia requested a review from a team October 10, 2019 21:52
@big-andy-coates
Copy link
Contributor Author

Thanks @big-andy-coates -- LGTM. Do you know when this regression was introduced? (Does this fix need to be back-ported?)

Not sure, but I don't think we do back ports do we?

@big-andy-coates big-andy-coates merged commit 5315f1e into confluentinc:master Oct 11, 2019
@big-andy-coates big-andy-coates deleted the set_property_handling branch October 11, 2019 09:49
@vcrfxia
Copy link
Contributor

vcrfxia commented Oct 11, 2019

Not sure, but I don't think we do back ports do we?

If we know this regression is present on in 5.3 as well we can back-port the fix to 5.3.x so that it goes out with the next 5.3 release (in this case, 5.3.2). And similarly for earlier branches. Not sure how severe the bug needs to be in order to warrant back-porting the fix but this particular one sounds pretty bad to me.

@vcrfxia
Copy link
Contributor

vcrfxia commented Oct 11, 2019

FWIW, tried it on 5.3.x right now and the bug is indeed present there.

Update: It's also present on 5.2.x, 5.1.x, and 5.0.x (didn't check on any earlier branches). Since it's always been present and the back-port looks like it'd be a lot of work, probably not worth the effort for this one.

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.

SET statements should only affect statements that follow it in multiline request
2 participants