Skip to content

KAFKA-9254: Overridden topic configs are reset after dynamic default change#7870

Merged
hachikuji merged 3 commits intoapache:trunkfrom
huxihx:KAFKA-9254
Jan 24, 2020
Merged

KAFKA-9254: Overridden topic configs are reset after dynamic default change#7870
hachikuji merged 3 commits intoapache:trunkfrom
huxihx:KAFKA-9254

Conversation

@huxihx
Copy link
Copy Markdown
Contributor

@huxihx huxihx commented Dec 25, 2019

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)

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

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.
@ijuma ijuma requested a review from rajinisivaram December 25, 2019 10:43
Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@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
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.

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
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.

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.

@huxihx
Copy link
Copy Markdown
Contributor Author

huxihx commented Jan 21, 2020

@rajinisivaram Please review the updated PR again. Thanks.

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@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")
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.

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?

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.

@huxihx I have pushed a commit with this minor change.

@rajinisivaram
Copy link
Copy Markdown
Contributor

retest this please

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@huxihx Thanks for the PR, LGTM. Will merge if the build passes.

Copy link
Copy Markdown
Contributor

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

LGTM also

@hachikuji
Copy link
Copy Markdown
Contributor

retest this please

@hachikuji hachikuji changed the title KAFKA-9254: Topic level configuration failed KAFKA-9254: Overridden topic configs are reset after dynamic default change Jan 24, 2020
@hachikuji hachikuji merged commit 790a39e into apache:trunk Jan 24, 2020
hachikuji pushed a commit that referenced this pull request Jan 24, 2020
…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>
hachikuji pushed a commit that referenced this pull request Jan 25, 2020
…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>
hachikuji pushed a commit to hachikuji/kafka that referenced this pull request Jan 25, 2020
…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>
hachikuji pushed a commit that referenced this pull request Jan 25, 2020
…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>
hachikuji pushed a commit that referenced this pull request Jan 25, 2020
…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>
hachikuji pushed a commit that referenced this pull request Jan 25, 2020
…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>
ijuma added a commit to confluentinc/kafka that referenced this pull request Jan 25, 2020
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
soondenana pushed a commit to soondenana/kafka that referenced this pull request Feb 8, 2020
…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)
hachikuji pushed a commit that referenced this pull request Mar 3, 2020
…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>
qq619618919 pushed a commit to qq619618919/kafka that referenced this pull request May 12, 2020
…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>
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.

3 participants