Disable mirrormaker2 offset-sync topics on source kafka cluster
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
MirrorMaker 2 (MM2) is a powerful tool from the Apache Kafka ecosystem designed to facilitate more reliable, scalable, and configurable data replication between Kafka clusters. It replaces the original MirrorMaker by providing enhancements like offset translation, automatic topic configuration, and streamlined cluster failover processes. However, managing MM2, specifically with regards to offset-sync topics in the source Kafka cluster, requires careful setup and configuration to avoid performance bottlenecks, data discrepancies, or increased administrative overhead.
Understanding Offset Sync Topics
When MM2 replicates data from a source Kafka cluster to a target Kafka cluster, it also stores the offsets of copied records in a special Kafka topic in the source cluster, known as the offset-sync topic. This topic stores the offset mappings between the source and target clusters, valuably aiding in disaster recovery scenarios by ensuring exact alignment of message sequence on both sides.
However, there can be situations where managing these offset-sync topics on the source cluster is undesirable. The reasons might include:
- Reducing load on the source Kafka cluster.
- Managing storage and operational costs.
- Simplifying Kafka administration in environments where strict data replication consistency isn't critical.
Disabling Offset Sync Topics
Disabling MM2's offset-sync topics on the source cluster requires modifications to the MM2 configuration. Follow these steps:
- Configuration Settings: Set
sync.topic.acls.enabledtofalsein your MirrorMaker 2 configuration. This prevents MM2 from attempting to create or manage ACLs for the sync topics, reducing some overhead. - Consumer offset storage: Set
offset.storage.replication.factorto a minimal value appropriate for your setup, typically1. This setting adjusts how resilient the offset storage itself needs to be, which helps in reducing the duplication of mirroring efforts.
Technical Implementation
You could implement these settings in a MirrorMaker 2 deployment YAML (if deploying within Kubernetes) or a properties file like this:
This configuration will aid in reducing unnecessary load and simplifying the management on the source Kafka cluster. However, ensure thorough testing in a controlled environment before applying such changes in production as they might affect your data recovery and replication capabilities.
Impact and Considerations
Disabling or tuning down the capabilities related to offset-sync topics have consequences:
- Data Consistency: In a DRP (Disaster Recovery Plan), offset alignment might be off, risking data loss or inconsistency after failover.
- Operational Complexity: Reduced complexity in handling less metadata but increased risk in maintaining exact data replicas between clusters.
- Performance: Reduced load on the source cluster which can enhance overall performance, but may compromise recovery operations.
Summary Table
| Feature | Benefit | Drawback |
| sync.topic.acls.enabled | Reduces ACL management overhead | May compromise security models |
| offset.storage.replication | Adjusts resource use for offset storage | Lower replication may risk data loss |
Additional Considerations
- Monitoring and Alerts: With reduced redundancy and safeguards, enhanced monitoring of the replication processes becomes crucial.
- Backup Strategies: Establish robust backup mechanisms to compensate for potential losses when sync topics are disabled or minimized.
- Testing and Validation: Regularly test failover procedures and data consistency checks to ensure that even with simplified configurations, the system behaves as expected.
By understanding and carefully managing these configuration settings, administrators can effectively balance between resource optimization on the source Kafka cluster and robustness of cross-cluster Kafka replication.

