...
Fetch
To avoid issues where FetchRequest(s) requests are made to stale topicspartitions, a topic_id field will be added to the request and responsefence reads for deleted topics.
FetchRequest v12
|
...
ListOffsets
To avoid issues where ListOffsetsRequest(s) requests are made to stale topicspartitions, a topic_id field will be added to the request and responsefence reads for deleted topics.
ListOffsetsRequest v6
|
...
OffsetForLeader
To avoid issues where OffsetForLeaderRequest(s) requests are made to stale topicspartitions, a topic_id field will be added to the request and responsefence reads for deleted topics.
OffsetForLeaderRequest v4
...
It would be ideal if the log.dir layout could be restructured from {topic}_{partition} format to {{topicIdprefix}}/{topicId}_{partition}, e.g. "mytopic_1" → "24/24cc4332-f7de-45a3-b24e-33d61aa0d16c_1". Note the hierarchical directory structure using the first two characters of the topic ID to avoid having too many directories at the top level of the logdir.
A broker cannot migrate partitions to the new directory structure until the inter.broker.protocol.version is bumped, as this will not be a backwards compatible change.
The migration may be tricky in other ways. The broker opens each partition on broker startup, before the LeaderAndIsrRequest is received. A broker will only know topic IDs for all of its TopicPartitions after receiving the first V3 LeaderAndIsrRequest for that partition. Moving directories around will be difficult at this point, as the logdirs are open, the broker needs to respond to the LeaderAndIsrRequest, etc.
Maybe the broker should set the topic ID in the metadata file first, and then move directories on the next startup before each log is openedThis change is not required for the topic deletion improvements above, and will be left for a future KIP where it may be required e.g. topic renames.