mjsax commented on code in PR #21503:
URL: https://github.com/apache/kafka/pull/21503#discussion_r2820244687


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBStore.java:
##########
@@ -391,7 +425,7 @@ public synchronized byte[] putIfAbsent(final Bytes key,
                                            final byte[] value) {
         Objects.requireNonNull(key, "key cannot be null");
         final byte[] originalValue = get(key);
-        if (originalValue == null) {
+        if (originalValue == null && value != null) {

Review Comment:
   This is a perf improvement -- realized this during PR review. If the 
original value does not exist, and `value == null` there is nothing to be 
deleted, and we can skip the `put()` call.
   
   Updated the corresponding unit tests accordingly.



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