hpoenixf commented on code in PR #24278:
URL: https://github.com/apache/kafka/pull/24278#discussion_r4681411228


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/LRUCacheEntry.java:
##########
@@ -93,13 +102,13 @@ public boolean equals(final Object o) {
             return false;
         }
         final LRUCacheEntry that = (LRUCacheEntry) o;
-        return sizeBytes == that.sizeBytes &&
+        return size() == that.size() &&
             isDirty() == that.isDirty() &&
             Objects.equals(record, that.record);

Review Comment:
   Addressed in 898a372. `LRUCacheEntry.equals()` now compares the fixed 
`sizeBytes` field, so releasing the retained raw-record charge does not affect 
equality. `hashCode()` explicitly rejects hashing, consistent with 
`ContextualRecord` and the entry’s mutable dirty state.
   
   I ran `ThreadCacheTest` and `NamedCacheTest` on macOS with OpenJDK 
17.0.21.0.3 at this commit. All 61 tests passed with no skips, including the 
new `entryEqualityIgnoresRetainedRawRecordCharge` regression.
   



-- 
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]

Reply via email to