-
Notifications
You must be signed in to change notification settings - Fork 332
SAMZA-2325 : Adding logic to read system config for repl-factor when creating a topic #1157
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9a7724a
Adding logic to read system config for repl-factor when creating a topic
rmatharu 7006ba7
Adding fix for changelog system
rmatharu 1375945
Updating getChangelogStream(name) in StorageConfig
rmatharu b79c98e
Undoing superfluous change
rmatharu 8651814
Simplyfying KafkaStreamSpec.toKafkaSpec
rmatharu e9fd653
Applying review comments, committing tests
rmatharu 2dd52b0
Addressing review comments
rmatharu 83213dc
Adding test removed in error
rmatharu 9d05eca
Updating getOrElse
rmatharu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -211,16 +211,26 @@ class TestKafkaConfig { | |
| kafkaProducerConfig.getProducerProperties | ||
| } | ||
|
|
||
| @Test | ||
| def testGetSystemDefaultReplicationFactor(): Unit = { | ||
| assertEquals(KafkaConfig.TOPIC_DEFAULT_REPLICATION_FACTOR, new KafkaConfig(new MapConfig()).getSystemDefaultReplicationFactor("kafka-system",KafkaConfig.TOPIC_DEFAULT_REPLICATION_FACTOR)) | ||
|
|
||
| props.setProperty("systems.kafka-system.default.stream.replication.factor", "8") | ||
| val mapConfig = new MapConfig(props.asScala.asJava) | ||
| val kafkaConfig = new KafkaConfig(mapConfig) | ||
| assertEquals("8", kafkaConfig.getSystemDefaultReplicationFactor("kafka-system","2")) | ||
| } | ||
|
|
||
| @Test | ||
| def testChangeLogReplicationFactor() { | ||
| props.setProperty("stores.store-with-override.changelog", "kafka-system.changelog-topic") | ||
| props.setProperty("stores.store-with-override.changelog.replication.factor", "3") | ||
| props.setProperty("stores.default.changelog.replication.factor", "2") | ||
|
|
||
| val mapConfig = new MapConfig(props.asScala.asJava) | ||
| val kafkaConfig = new KafkaConfig(mapConfig) | ||
| assertEquals("3", kafkaConfig.getChangelogStreamReplicationFactor("store-with-override")) | ||
| assertEquals("2", kafkaConfig.getChangelogStreamReplicationFactor("store-without-override")) | ||
| assertEquals("2", kafkaConfig.getDefaultChangelogStreamReplicationFactor) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add unit tests for the new flows in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in TestKafkaConfig and updated others |
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -231,24 +241,24 @@ class TestKafkaConfig { | |
| // Override the "default" default value | ||
| props.setProperty("stores.default.changelog.replication.factor", "5") | ||
|
|
||
|
|
||
| val mapConfig = new MapConfig(props.asScala.asJava) | ||
| val kafkaConfig = new KafkaConfig(mapConfig) | ||
| assertEquals("4", kafkaConfig.getChangelogStreamReplicationFactor("store-with-override")) | ||
| assertEquals("5", kafkaConfig.getChangelogStreamReplicationFactor("store-without-override")) | ||
| assertEquals("5", kafkaConfig.getDefaultChangelogStreamReplicationFactor) | ||
| } | ||
|
|
||
| @Test | ||
| def testChangeLogReplicationFactorWithSystemOverriddenDefault() { | ||
| props.setProperty(StorageConfig.CHANGELOG_SYSTEM, "kafka-system") | ||
| props.setProperty("systems.kafka-system.default.stream.replication.factor", "8") | ||
| props.setProperty("stores.store-with-override.changelog.replication.factor", "4") | ||
| props.setProperty("stores.store-without-override.changelog", "change-for-store-without-override") | ||
|
|
||
| val mapConfig = new MapConfig(props.asScala.asJava) | ||
| val kafkaConfig = new KafkaConfig(mapConfig) | ||
| assertEquals("4", kafkaConfig.getChangelogStreamReplicationFactor("store-with-override")) | ||
| assertEquals("8", kafkaConfig.getChangelogStreamReplicationFactor("store-without-override")) | ||
| assertEquals("8", kafkaConfig.getDefaultChangelogStreamReplicationFactor) | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify my understanding: Is RF correctly configurable for the above cases (changelog, coordinator, intermediate streams), but not other cases? So would an example case impacted by this block be diagnostics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and for changelog not all configs were being respected (see getChangelogStreamReplicationFactor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, right. Although the fix for changelog was done in
KafkaConfig, and then the fix for some of the other stream types was done here.Thanks for clarifying.