You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Colin McCabe (Jira)" <ji...@apache.org> on 2021/12/03 01:32:00 UTC

[jira] [Resolved] (KAFKA-12682) Kraft MetadataPartitionsBuilder _localChanged and _localRemoved out of order

     [ https://issues.apache.org/jira/browse/KAFKA-12682?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colin McCabe resolved KAFKA-12682.
----------------------------------
    Fix Version/s: 3.0.0
         Assignee: Colin McCabe  (was: Justine Olshan)
       Resolution: Fixed

This was fixed in 3.0 when we rewrote the ReplicaManager logic for KRaft.

> Kraft MetadataPartitionsBuilder _localChanged and _localRemoved out of order 
> -----------------------------------------------------------------------------
>
>                 Key: KAFKA-12682
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12682
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.8.0
>            Reporter: jacky
>            Assignee: Colin McCabe
>            Priority: Major
>              Labels: kip-500
>             Fix For: 3.0.0
>
>
> In version 2.8, MetadataPartitionsBuilder has the field _localChanged and _localRemoved which record the change and delete partition, but we always process _localChanged partitions, and then _localRemoved in the kafka.server.RaftReplicaManager#handleMetadataRecords, not respect the original order, for example, 
> 1. migrate the partition p1 from b0 to b1;
> 2. change the leader of p1 
> 3.migrate p1 from b1 to b0
> and the _localRemoved will delete the p1 at last.
> and I think MetadataPartition should include topic uuid, and the topic name is optional
> for example,
> create topic t1, delete topic t1, create topic t1, change leader of p1
> and then compact the records 
> delete topic t1, change t1, p1
> but currently, implementation will be
> 1. process change t1, p1
> 2. process delete topic t1
> but the MetadataPartition doesn't include topic uuid, it only includes topic name, when to process, it can't find the origin topic uuid, and find the latest the topic id, but it's not right. and delete topic t1 should do before create t1 or change p1.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)