KAFKA-9254: Overridden topic configs are reset after dynamic default change#7870
KAFKA-9254: Overridden topic configs are reset after dynamic default change#7870hachikuji merged 3 commits intoapache:trunkfrom
Conversation
https://issues.apache.org/jira/browse/KAFKA-9254 Currently, when dynamic broker config is updated, the log config will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs will lost.
rajinisivaram
left a comment
There was a problem hiding this comment.
@huxihx Thanks for the PR, looks good. Left a couple of minor comments on the test.
| } | ||
|
|
||
| log = servers.head.logManager.getLog(new TopicPartition(topic2, 0)).getOrElse(throw new IllegalStateException("Log not found")) | ||
| assertEquals(log.config.overriddenConfigs.size, 1) // Verify topic-level config survives |
There was a problem hiding this comment.
It may be good to check the actual config value
| } | ||
|
|
||
| log = servers.head.logManager.getLog(new TopicPartition(topic2, 0)).getOrElse(throw new IllegalStateException("Log not found")) | ||
| assertEquals(log.config.overriddenConfigs.size, 1) // Verify topic-level config still survives |
There was a problem hiding this comment.
As before, it may be good to check the actual config expected. It would also be useful to verify the behaviour after updating and removing broker-level MinInSyncReplicasProp.
|
@rajinisivaram Please review the updated PR again. Thanks. |
rajinisivaram
left a comment
There was a problem hiding this comment.
@huxihx Thanks for the updates. Left a minor comment, apart from that LGTM.
| TestUtils.createTopic(zkClient, topic2, 1, replicationFactor = numServers, servers, topicProps) | ||
| var log = servers.head.logManager.getLog(new TopicPartition(topic2, 0)).getOrElse(throw new IllegalStateException("Log not found")) | ||
| assertTrue(log.config.overriddenConfigs.contains(KafkaConfig.MinInSyncReplicasProp)) | ||
| assertEquals(log.config.originals().get(KafkaConfig.MinInSyncReplicasProp).toString, "2") |
There was a problem hiding this comment.
assertEquals uses expected as the first arg and actual as the second. Can you reverse the args here and in the other usages below to ensure that any error messages appear correctly if the test fails?
There was a problem hiding this comment.
@huxihx I have pushed a commit with this minor change.
|
retest this please |
rajinisivaram
left a comment
There was a problem hiding this comment.
@huxihx Thanks for the PR, LGTM. Will merge if the build passes.
|
retest this please |
…change (#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
…change (#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
…change (apache#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
…change (#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
…change (#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
…change (#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
Conflicts and/or compiler errors due to the fact that we temporarily reverted the commit that removes Scala 2.11 support: * Exit.scala: replace SAMs with anonymous inner classes. * MiniKdc.scala: take upstream changes. # By A. Sophie Blee-Goldman (1) and others # Via Jason Gustafson * apache-github/trunk: KAFKA-9254; Overridden topic configs are reset after dynamic default change (apache#7870) MINOR: MiniKdc JVM shutdown hook fix (apache#7946) KAFKA-9152; Improve Sensor Retrieval (apache#7928) Correct exception message in DistributedHerder (apache#7995) KAFKA-7317: Use collections subscription for main consumer to reduce metadata (apache#7969) KAFKA-9181; Maintain clean separation between local and group subscriptions in consumer's SubscriptionState (apache#7941) KAFKA-7737; Use single path in producer for initializing the producerId (apache#7920) # Conflicts: # core/src/test/scala/kafka/security/minikdc/MiniKdc.scala
…change (apache#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io> (cherry picked from commit 0e7f867)
…change (#7870) (#8067) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io> (cherry picked from commit 0e7f867) Co-authored-by: huxi <huxi_2b@hotmail.com>
…change (apache#7870) Currently, when a dynamic change is made to the broker-level default log configuration, existing log configs will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs are lost. This can cause unexpected data loss, for example, if the cleanup policy changes from "compact" to "delete." Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Jason Gustafson <jason@confluent.io>
https://issues.apache.org/jira/browse/KAFKA-9254
Currently, when dynamic broker config is updated, the log config will be recreated with an empty overridden configs. In such case, when updating dynamic broker configs a second round, the topic-level configs will lost.
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)