Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-4547

Allow DictKeys to cache shared keys from query results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Beryllium
    • 3.1.0
    • LiteCore
    • Security Level: Public
    • LiteCore 108, LiteCore 109, LiteCore 115, LiteCore 119
    • 4

    Description

      This is a follow-up of an external PR, https://github.com/couchbase/couchbase-lite-core/pull/1642.

      After commit dcaa54943e6 to fleece, we added a condition to cache Dict::key::_numericKey. This condition accidentally keeps the Query result to cache the keys unnecessarily. 

      The main idea of the PR is valid, but Jens Alfke suggested better solution:

      "I think the solution may be to add a cacheable flag to SharedKeys. It defaults to true, but there's a disableCaching method that forces it to return false. PersistentSharedKeys sets it to false while it's in a transaction.

      "DictKey can then check sk->cacheable() instead of !sk->inTransaction().

      "And DBAccess would call disableCaching on its tempSharedKeys."

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jianmin.zhao Jianmin Zhao
            jianmin.zhao Jianmin Zhao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty