vvcephei commented on a change in pull request #8905: URL: https://github.com/apache/kafka/pull/8905#discussion_r446365992
########## File path: streams/src/main/java/org/apache/kafka/streams/state/internals/InMemoryTimeOrderedKeyValueBuffer.java ########## @@ -258,34 +263,43 @@ private void logValue(final Bytes key, final BufferKey bufferKey, final BufferVa final int sizeOfBufferTime = Long.BYTES; final ByteBuffer buffer = value.serialize(sizeOfBufferTime); buffer.putLong(bufferKey.time()); - + final byte[] array = buffer.array(); ((RecordCollector.Supplier) context).recordCollector().send( - changelogTopic, - key, - buffer.array(), - V_2_CHANGELOG_HEADERS, - partition, - null, - KEY_SERIALIZER, - VALUE_SERIALIZER + changelogTopic, + key, + array, + CHANGELOG_HEADERS, + partition, + null, + KEY_SERIALIZER, + VALUE_SERIALIZER ); } private void logTombstone(final Bytes key) { ((RecordCollector.Supplier) context).recordCollector().send( - changelogTopic, - key, - null, - null, - partition, - null, - KEY_SERIALIZER, - VALUE_SERIALIZER + changelogTopic, + key, + null, + null, Review comment: I remember considering this when I added the first version header. The reason I didn't is that, since the initial version didn't have any headers, even if we change the tombstone format in the future, we'll always have to interpret a "no header, null value" record as being a "legacy format" tombstone, just like we have to interpret a "no header, non-null value" as being a "legacy format" data record. You can think of "no header" as indicating "version 0". Since we haven't changed the format of tombstones _yet_, there's no value in adding a "version 1" flag. We should just wait until we do need to make such a change (if ever). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org