Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-20528

ep_num_ops_get_meta may not count requests which are non-resident

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 4.6.0
    • 4.0.0, 4.1.0, 4.5.0
    • couchbase-bucket
    • None
    • Untriaged
    • Yes

    Description

      (Spun out from MB-20328):

      We have a bug in the ep_num_ops_get_meta stat which was introduced in 4.0.0:

      • Prior to that release (e.g. 3.1.5), ep_num_ops_get_meta counted all requests - successful or unsuccessful. See http://src.couchbase.org/source/xref/3.1.5/ep-engine/src/ep.cc#1769 - note that if a StoredValue is found - v is non-null - then we increment stats.numOpsGetMeta. If v is null then we always call addTempItemForBgFetch - which essentially will always result suspending the request (EWOULDBLOCK) while the disk fetch occurs, after which it'll retry the request - i.e EventuallyPersistentStore::getMetaData will be called again, v will be non-NULL and stats.numOpsGetMeta will get incremented.
      • In 4.0.0, when bloomfilters were introduced, ep_num_ops_get_meta no longer counts requests to items which are not resident and the bloomfilter tells us are not on disk - the else clause no longer unconditionally triggers a BGfetch - and crucially doesn't increment stats.numOpsGetMeta

          } else {
      1994        // The key wasn't found. However, this may be because it was previously
      1995        // deleted or evicted with the full eviction strategy.
      1996        // So, add a temporary item corresponding to the key to the hash table
      1997        // and schedule a background fetch for its metadata from the persistent
      1998        // store. The item's state will be updated after the fetch completes.
      1999        //
      2000        // Schedule this bgFetch only if the key is predicted to be may-be
      2001        // existent on disk by the bloomfilter.
      2002
      2003        if (vb->maybeKeyExistsInFilter(key)) {
      2004            return addTempItemForBgFetch(lh, bucket_num, key, vb, cookie, true);
      2005        } else {
      2006            return ENGINE_KEY_ENOENT;
      2007        }
      

      We need to fix the code so ep_num_ops_get_meta is incremented for all results of the request - i.e. also when the above code directly returns ENGINE_KEY_ENOENT.

      Attachments

        Issue Links

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

          Activity

            People

              sriram Sriram Ganesan (Inactive)
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty