Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5717

[streams] 'null' values in state stores

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.2.1, 0.11.0.0
    • 0.11.0.1, 1.0.0
    • streams
    • None

    Description

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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            damianguy Damian Guy
            clouTrix Bart Vercammen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment