Versions Compared

Key

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

...


LeaderAndIsrRequest v5 adds the topic ID to the topic_states field, and an enum type to denote the type of LeaderAndIsrRequest. Currently, the first LeaderAndIsrRequest sent to a broker by a controller contains all TopicPartitions that a broker is a replica for. We will formalize this behavior by also including a type enum to denote the type of LeaderAndIsrRequest.  IBP will be used to determine whether this new form of the request will be used. For older requests, we will ignore this field and default to previous behavior.

valueenumdescription
0UNSPECIFIEDUnspecified type. Defaults to incremental / previous behavior.
1INCREMENTALA LeaderAndIsrRequest that is not guaranteed to contain all topic partitions assigned to a broker.

2

FULLA full LeaderAndIsrRequest containing all partitions the broker is a replica for.

...

Reconciliation may also be necessary if type = INCREMENTAL and the topic ID set on a local partition does not match the topic ID contained in the request. A TopicPartition with the same name and a different topic ID by implies that the local topic partition is stale, as the topic must have been deleted to create a new topic with a different topic ID.

When type = UNSPECIFIED, the request will be treated in a way that allows for backwards compatibility with older request types.

Deletion

Deletion of stale partitions triggered by LeaderAndIsrRequest(s) will take place by:

...

  1. Collect deleted topics:
    1. Old format: /admin/delete_topics pulling the topic state from /brokers/topics/[topic].
    2. New in-memory topic deletion states from received DeleteTopicsRequest(s) 
  2. Remove deleted topics from replicas by sending StopReplicaRequest V3 before the IBP bump using the old logic, and using V4 and the new logic with topic IDs after the IBP bump.
  3. Finalize successful deletes:
    1. For /admin/delete_topics deletes, we may need to respond to the TopicDeleteRequest. We can also delete the topic znode at /admin/delete_topics/[topic] and /brokers/topics/[topic].
    2. For deletes for topics with topic IDs, remove the topic from the in memory topic deletion state on the controller.
  4. Any unsuccessful StopReplicaRequest(s) will be retried after retryMs, starting from 1) and will be maintained in memory.

...

LeaderAndIsrRequest(s) will only be sent by the controller once a topic ID has been successfully assigned to the topic.  Since the LeaderAndIsrRequest version was bumped, the IBP must also be bumped for migration.

When a replica receives a LeaderAndIsrRequest containing a topic ID for an existing partition which does not have a topic ID associated, it will create a partition metadata file for the topic partition locally. At this point the local partition will have been migrated to support topic IDs.

...