feat(datahub-upgrade): reconcile configProperties on existing kafka topics#17778
Merged
Conversation
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
Linear: PFP-4282 Thanks for your contribution! We have created an internal ticket to track this PR. A member of the core DataHub team will be assigned to review it within the next few business days - you will get a follow-up comment once a reviewer is assigned. |
…opics Add opt-in KAFKA_SETUP_RECONCILE_EXISTING_TOPIC_CONFIGS flag. When enabled, CreateKafkaTopicsStep applies declared configProperties to topics that already exist via incrementalAlterConfigs (additive SET — undeclared keys are not touched). Default false to preserve current behavior on deployments with restricted Kafka ALTER_CONFIGS permissions. Closes the gap where broker auto-created topics keep broker-default retention (notably DataHubUpgradeHistory_v1 which must have retention.ms=-1 per DataHub deployment requirements).
- Hoist the single AlterConfigOp construction out of the if/else branches in diffConfigs; the two branches now only differ in which log list they populate, the SET op is shared. - Drop the one-line TopicConfigDiff.isEmpty() helper; the single call site now checks diff.ops().isEmpty() directly.
david-leifker
approved these changes
Jun 12, 2026
- Add testReconcileEmitsChangedDiffWhenBrokerValueDiffers exercising the live!=null && !live.equals(desired) branch of diffConfigs (changed.add, ops.add, totalChanged accumulator). Closes the 4-line patch-coverage gap reported by codecov. - Register kafka.setup.reconcileExistingTopicConfigs in PropertiesCollectorConfigurationTest's NON_SENSITIVE_PROPERTIES next to the other kafka.setup.* booleans. The flag is a plain feature toggle, not credential material.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Symptom
GMS pods enter a crash loop with
/healthreturning 503, blocked on bootstrap step 1/12WaitForSystemUpdateStep. That step waits for a "system update completed" marker onDataHubUpgradeHistory_v1. When the topic runs on broker-defaultretention.ms(commonly 7 days: e.g. because it was auto-created or pre-existed before being declared inapplication.yamlcausing the marker aging out and GMS never becomes Ready.GMS consumer log when this happens:
Fix
Add opt-in
KAFKA_SETUP_RECONCILE_EXISTING_TOPIC_CONFIGS(defaultfalse).So we keep the default behaviour (Useful for deployments with restricted Kafka
ALTER_CONFIGSpermissions.)When enabled,
CreateKafkaTopicsStepreconciles with application.yml, declaredconfigPropertieson topics that already exist viaincrementalAlterConfigs.This is how the behaviour will work when
true:application.yamlare never touched.describeConfigsis called first; topics whose declared keys already match the broker are skipped, and noAlterConfigsrequest is issued in the all-match case.Today
CreateKafkaTopicsSteponly sets configs at creation time, so this drift (notablyretention.msonDataHubUpgradeHistory_v1) is never corrected on subsequent runs.New Log format
Per-topic lines use diff prefixes; both emit
AlterConfigOpwithOpType.SET:~ key: old -> new— broker returned a value for the key and it differs from the declared one (common case).+ key=new— key was absent fromdescribeConfigs(rare for standard topic configs, since Kafka surfaces inherited defaults).At the end of this step, in the logs, the summary
Successfully applied configProperty changes on N topics (X added, Y changed)makes a no-op rollout trivially distinguishable from an effective one.Validation
Verified end-to-end on a cluster with the flag enabled — 7 topics declared
configProperties, 2 already matched the broker and were skipped per-topic,incrementalAlterConfigswas issued for the remaining 5:e.g.:
If we rerun the process against the same broker we get no-ops (all 7 took the "already match" branch).
Flag-off path also verified:
describeConfigs/incrementalAlterConfigsare not called, behavior is identical tomaster.