Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stop Mirror Topics

  1. User sends StopMirrorTopicsRequest StopMirrorTopics request with mirror name, topics, and optional patterns.
  2. If patterns are provided, the controller removes matching entries from mirror.topics.include and adds them to mirror.topics.exclude on the MIRROR resource in the metadata log. Any currently mirroring topic that matches the updated exclude is also stopped.
  3. For each topic, the controller writes a ConfigRecord updating mirror.name=<mirrorName>.stopped on the TOPIC resource.
  4. Brokers receive the metadata update. The MirrorMetadataManager detects the .stopped suffix and transitions partitions to STOPPING.
  5. During STOPPING, the following operations execute sequentially:
    1. Fetcher threads are removed for the affected partitions stopping replication.
    2. The current leader epoch is collected and persisted as LME in __mirror_state.
    3. The partition's leader epoch is bumped to draw a boundary between mirrored and locally produced records.
    4. ABORT markers are appended for all ongoing transactions using the new leader epoch.

    5. A MIRROR_PID_RESET control record is written to expire all producer state entries.

  6. Partitions transition to STOPPED and becomes writable.

...

  1. User sends PauseMirrorTopics request with topics and mirror name.
  2. The controller validates each topic belongs to the specified mirror and is currently in MIRRORING state. It appends updates the .paused suffix to the mirror name config, e.g. to mirror.name=my-mirror<mirrorName>.paused, generating a ConfigRecord.
  3. When the MirrorMetadataManager in the partition leader node gets notified, it detects the .paused suffix . It and transitions the state to PAUSING.
  4. During PAUSING, the MirrorFetcherManager removes the fetcher threads for the affected partitions. No more data is replicated.
  5. The state transitions from PAUSING to PAUSED. The partition remains read only. Metadata synchronization (configs, groups, ACLs) is also halted paused for the paused these topics.
  6. The partition state change is persisted to the __mirror_state topic.

...

  1. User sends ResumeMirrorTopics request with topics and mirror name.
  2. The controller validates the topic is currently paused (has .paused suffix). It removes the .paused suffix, restoring the original mirror name , e.g. mirror.name=cluster1, and generating a ConfigRecord.
  3. When the MirrorMetadataManager in the partition leader node gets notified, it detects that mirror.name no longer has the .paused suffix.
  4. The state transitions directly from PAUSED to MIRRORING. No log truncation is needed because the partition is already at the correct offset from before the pause.
  5. New MirrorFetcherThread instances are created and resume replication from the current log end offset.
  6. Metadata synchronization (configs, groups, ACLs) also resumes.

...