Chia-Ping Tsai created KAFKA-21436:
--------------------------------------
Summary: CoordinatorContext#load could complete the wrong context
if the leader is lost and regained during loading
Key: KAFKA-21436
URL: https://issues.apache.org/jira/browse/KAFKA-21436
Project: Kafka
Issue Type: Bug
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
loader.load(tp, coordinator).whenComplete((summary, exception) -> {
scheduleInternalOperation("CompleteLoad(tp=" + tp + ", epoch="
+ epoch + ")", tp, () -> {
CoordinatorContext context = coordinators.get(tp);
{code}
If loader.load is still running and the leader gets removed and added back, the
following coordinators.get(tp) could return the new CoordinatorContext. As a
result, the new context is transitioned to ACTIVE and starts to serve requests
before its own load runs. If the old load fails instead, the new context is
transitioned to FAILED.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)