squah-confluent commented on code in PR #24146:
URL: https://github.com/apache/kafka/pull/24146#discussion_r4516811053


##########
server-common/src/main/java/org/apache/kafka/timeline/SnapshottableHashTable.java:
##########
@@ -128,6 +128,7 @@ public void mergeFrom(long epoch, Delta source) {
                             deltaTable.baseAddOrReplace(element);
                         }
                     }
+                    list.clear();

Review Comment:
   The `deltaTable.capacity <= currentTable.capacity` invariant seems pretty 
easy to break by accident. I wonder if there is a good way to enforce it, such 
as specifying a max capacity when creating the delta table (the delta table for 
epoch N cannot contain more entries than the current table at the start of the 
epoch, so I think it's okay to freeze the max capacity to match the current 
table at the start of the epoch). That kind of change probably belongs in a 
separate PR.



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