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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:
##########
@@ -596,7 +596,11 @@ private void readTaskStatus(String key, byte[] value) {
         synchronized (this) {
             log.trace("Received task {} status update {}", id, status);
             CacheEntry<TaskStatus> entry = getOrAdd(id);
-            entry.put(status);
+            if (entry.canWriteSafely(status)) {

Review Comment:
   I did some more testing on this. One thing I would like to highlight is 
`putSafe` is also prone to letting stale updates go through from the same 
worker. So, the staleness checks at read time (added in this PR) can only 
prevent stale updates from other workers.
   Note that, this changes the current behaviour when reading the write made by 
the `put` call as well i.e stale updates from other workers don't reflect 
anymore. This is reflective in the change I made in 
`putConnectorStateShouldOverride`. 



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to