Skip to content

MINOR: Add select changes from 3rd KIP-307 PR for incrementing name index counter#6754

Merged
bbejeck merged 4 commits intoapache:trunkfrom
bbejeck:MINOR_add_name_counter_incrementing_KIP_307
May 17, 2019
Merged

MINOR: Add select changes from 3rd KIP-307 PR for incrementing name index counter#6754
bbejeck merged 4 commits intoapache:trunkfrom
bbejeck:MINOR_add_name_counter_incrementing_KIP_307

Conversation

@bbejeck
Copy link
Copy Markdown
Member

@bbejeck bbejeck commented May 17, 2019

When users provide a name for operation via the Streams DSL, we need to increment the counter used for auto-generated names to make sure any operators downstream of a named operator still produce a compatible name.

This PR is a subset of #6411 by @fhussonnois. We need to merge this PR now because it covers cases when users name repartition topics or state stores.

Updated tests to reflect the counter produces expected number even when the user provides a name.

Committer Checklist (excluded from commit message)

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

@bbejeck
Copy link
Copy Markdown
Member Author

bbejeck commented May 17, 2019

expected + "-table-source",
"KSTREAM-SOURCE-0000000002",
"KTABLE-SOURCE-0000000003");
"KSTREAM-SOURCE-0000000004",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These number changes are valid as 2 store names (internal, not visible for IQ) are generated. I validated the topology description against a description generated by 2.2

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.

I see. So the diff we're seeing is against tests that were previously modified (incorrectly) to match the non-incrementing behavior that you're fixing right now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, that is correct.

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.

perfect. thanks for the reassurance!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, those test are newly added in a previous KIP-307 PR... But if Bill check agains 2.2, it should be fine.

builder.build();
final ProcessorTopology topology = builder.internalTopologyBuilder.rewriteTopology(new StreamsConfig(props)).build();
assertSpecifiedNameForOperation(topology, expected, "KSTREAM-SOURCE-0000000000");
assertSpecifiedNameForOperation(topology, expected, "KSTREAM-SOURCE-0000000001");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

First source node would be KSTREAM-SOURCE-0000000000 so this is a valid change in the test

builder.build();
final ProcessorTopology topology = builder.internalTopologyBuilder.rewriteTopology(new StreamsConfig(props)).build();
assertSpecifiedNameForOperation(topology, "KSTREAM-SOURCE-0000000000", expected, "KSTREAM-SINK-0000000001");
assertSpecifiedNameForOperation(topology, "KSTREAM-SOURCE-0000000000", expected, "KSTREAM-SINK-0000000002");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The first source is KSTREAM-SOURCE-0000000000 second would be ...01 so this change is correct.

@vvcephei
Copy link
Copy Markdown
Contributor

Hey @bbejeck , thanks for fixing this!

I found the logic a little hard to follow, so I pulled it down to play around with it. I think that the original decision to use the Optional FP logic instead of branches, and also making the provider nullable (which was only in support of one test :/ ), was what was making it so convoluted.

What do you think about this: bbejeck#1 ?

Copy link
Copy Markdown
Member

@mjsax mjsax left a comment

Choose a reason for hiding this comment

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

LGTM.

bbejeck and others added 2 commits May 17, 2019 13:53
Proposal: flatten name generation logic for readability
@mjsax
Copy link
Copy Markdown
Member

mjsax commented May 17, 2019

Still LGTM

@bbejeck bbejeck merged commit 9077d83 into apache:trunk May 17, 2019
@bbejeck
Copy link
Copy Markdown
Member Author

bbejeck commented May 17, 2019

Merged #6754 into trunk.

pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…ndex counter (apache#6754)

When users provide a name for operation via the Streams DSL, we need to increment the counter used for auto-generated names to make sure any operators downstream of a named operator still produce a compatible name.

This PR is a subset of apache#6411 by @fhussonnois. We need to merge this PR now because it covers cases when users name repartition topics or state stores.

Updated tests to reflect the counter produces expected number even when the user provides a name.

Matthias J. Sax <mjsax@apache.org>,  John Roesler <john@confluent.io>
@mjsax mjsax added the kip Requires or implements a KIP label Jun 12, 2020
@bbejeck bbejeck deleted the MINOR_add_name_counter_incrementing_KIP_307 branch July 10, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kip Requires or implements a KIP streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants