Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0, 0.9.1
    • Fix Version/s: 0.10.0
    • Component/s: kv
    • Labels:
      None

      Description

      The CachedStore wrapper class flushes on every put or putAll that dirties the cache. This seems rooted in a misunderstanding of LinkedHashMap.removeEldestEntry. This method is called on every put() or putAll() to the map, and the implementation in CachedStore flushes the dirty entries without first checking if the cache is at capacity. Interestingly, fixing this issue reveals another in org.apache.samza.storage.kv.TestKeyValueStores#putAndGet. This test unintentionally relies on the inefficient behavior in CachedStore to handle array keys. Specifically, even though different array instances can never get cache hits due to pass-by-reference semantics in the cache, the existing flushing behavior causes the arrays to get prematurely written to the store which has pass-by-value semantics.

        Attachments

          Activity

            People

            • Assignee:
              twbecker Tommy Becker
              Reporter:
              twbecker Tommy Becker
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: