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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]