You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "vamossagar12 (via GitHub)" <gi...@apache.org> on 2023/05/20 04:09:50 UTC

[GitHub] [kafka] vamossagar12 commented on a diff in pull request #13453: KAFKA-12525: Ignoring Stale status statuses when reading from Status …

vamossagar12 commented on code in PR #13453:
URL: https://github.com/apache/kafka/pull/13453#discussion_r1199554121


##########
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:
##########
@@ -608,6 +608,20 @@ private void readTaskStatus(String key, byte[] value) {
         synchronized (this) {
             log.trace("Received task {} status update {}", id, status);
             CacheEntry<TaskStatus> entry = getOrAdd(id);
+
+            // During frequent rebalances, there could be a race condition because of which
+            // an UNASSIGNED state of a prior generation can be sent by a worker despite a
+            // RUNNING status in a newer generation by another worker because the first worker
+            // couldn't read the newer RUNNING status. This can lead to an inaccurate status
+            // representation even though the task might be actually running.
+            if (status.state() == ConnectorStatus.State.UNASSIGNED

Review Comment:
   Thats'a good catch @Lucent-Wong . Since both extend from `AbstractStatus` I didn't realise I was using `ConnectorStatus`. I changed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org