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

Improve synchronization in CachingKeyValueStore methods

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: streams
    • Labels:
      None

      Description

      Currently CachingKeyValueStore methods are synchronized at method level.

      It seems we can use read lock for getter and write lock for put / delete methods.

      For getInternal(), if the underlying thread is streamThread, the getInternal() may trigger eviction. This can be handled by obtaining write lock at the beginning of the method for streamThread.

        Attachments

        1. 6412-jmh.v1.txt
          26 kB
          Ted Yu
        2. k-6412.v1.txt
          6 kB
          Ted Yu

          Issue Links

            Activity

              People

              • Assignee:
                tedyu Ted Yu
                Reporter:
                yuzhihong@gmail.com Ted Yu
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: