Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7739 Kafka Tiered Storage
  3. KAFKA-15084

Remove lock contention in RemoteIndexCache

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.6.0
    • core
    • None

    Description

      RemoteIndexCache cache is accessed from multiple threads concurrently in the fetch from consumer code path [1]

      Currently, the RemoteIndexCache uses LinkedHashMap as the cache implementation internally. Since LinkedHashMap is not a thread safe data structure, we use coarse grained lock on the entire map/cache when writing to the cache.

      This means that if a thread if fetching information from a particular segment from RemoteStorageManager, other threads who are trying to access a different segment from the cache will also wait for the former thread to complete. This is due to the usage of global lock in the cache.

      This lock contentions leads to decrease in throughput for fetch from consumer for cases where RSM network call may take more time.

      As a goal for this JIRA, we would like to ensure that the threads reading existing values in the cache do not get blocked when thread updating the cache is fetching data.

      Attachments

        Issue Links

          Activity

            People

              divijvaidya Divij Vaidya
              divijvaidya Divij Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: