kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Vercammen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KAFKA-5717) [streams] 'null' values in state stores
Date Wed, 09 Aug 2017 10:48:00 GMT
Bart Vercammen created KAFKA-5717:

             Summary: [streams] 'null' values in state stores
                 Key: KAFKA-5717
                 URL: https://issues.apache.org/jira/browse/KAFKA-5717
             Project: Kafka
          Issue Type: Bug
          Components: streams
    Affects Versions:,
            Reporter: Bart Vercammen

When restoring the state on an in-memory KeyValue store (at startup of the Kafka Streams application),
the _deleted_ values are put in the store as _key_ with _value_ {{null}} instead of being
removed from the store.
(this happens when the underlying kafka topic segment did not get compacted yet)

After some digging I came across this in {{InMemoryKeyValueStore<K, V>}}:
public synchronized void put(K key, V value) {
        this.map.put(key, value);

I would assume this implementation misses the check on {{value}} being {{null}} to *delete*
the entry instead of just storing it.

In the RocksDB implementation it is done correctly:
if (rawValue == null) {
            try {
                db.delete(wOptions, rawKey);

This message was sent by Atlassian JIRA

View raw message