...
Currently Mirrormaker uses deprecated alterConfigs API when syncing topic configurations for broker compatibility to 0.11.0. In addition, Mirromaker has a configurable ConfigPropertyFilter
class to select the topic configuration properties to replicate and uses `orgorg.apache.kafka.connect.mirror.DefaultConfigPropertyFilter
| by default. The default class excludes certain topic configurations from replication such as follower.replication.throttled.replicas and leader.replication.throttled.replicas.
...
MirrorMaker should not clear topic configurations that are excluded from replication.
In addition, source and target topic configurations could have different default values. Currently, Mirrormaker overwrites configurations on target topic even if the configurations on the source topic have not been changed but happened to have different default values. However, user may only want to sync configurations that they have changed but leave the ones with default values.
Public Interfaces
This KIP proposes to migrate to incrementalAlterConfigs
API for syncing topic configurations in MirrorMaker. The incrementalAlterConfigs
API has been around for several years since it was introduced in Kafka 2.3.0 and addresses the shortcoming of the deprecated alterConfigs
API. In order not to break the compatibility, we will introduce a new setting to MirrorMaker to give the option to enable incrementalAlterConfigs
API for syncing topic configuraMirrorMaker syncs topic configurations whether they are filter or not. This new setting is expected to serve as a temporary measure until the next major release when the API is always used.
It also proposes to add an option to use the target cluster default for the target topic configurations instead of the source cluster default. For example, if the user wants to use the target cluster default, the ConfigPropertyFilter
would be used to check if the configuration on the source topic has been dynamically set, so that it only then can gets replicated to the target topic.
Proposed Changes
1) Add a new method updateTopicConfigsUsingIncrementalAlterConfigs() to MirrorSourceConnector.java
which takes a list topic configurations as a parameter and calls incrementalAlterConfigs()
to the target cluster.
2) Extend ConfigPropertyFilter
class to have a method called shouldReplicateSourceDefault
which can be used to replicate only if the configuration source is not DEFAULT_CONFIG.
2) Add a new configuration setting to MirrorMaker:
...