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

Append operations not tracked under cmd_set statistic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.1.0, 5.1.1
    • 5.0.0, 5.1.0
    • memcached
    • None
    • Untriaged
    • Yes

    Description

      Append operations are no longer tracked under the cmd_set statistic.

      This used to work in the 4.6.x line of releases and looking at the code it looks like the intent is that it should still be tracked https://github.com/couchbase/kv_engine/blob/b999dd38ecf0c8d579f34f438b84f2469da51396/daemon/protocol/mcbp/appendprepend_context.cc#L67.

      Think the behavior changed in https://github.com/couchbase/kv_engine/commit/dd9518762e9eab71a6080795ae2db3fb27a468a2#diff-86ca1008bc12a7020be8146e4a8ec076.

      Looking at the code:

          auto ret = ENGINE_SUCCESS;
          do {
              switch (state) {
              case State::ValidateInput:
                  ret = validateInput();
                  break;
              case State::InflateInputData:
                  ret = inflateInputData();
                  break;
              case State::GetItem:
                  ret = getItem();
                  break;
              case State::AllocateNewItem:
                  ret = allocateNewItem();
                  break;
              case State::StoreItem:
                  ret = storeItem();
                  break;
              case State::Reset:
                  ret = reset();
                  break;
              case State::Done:
                  return ENGINE_SUCCESS;
              }
          } while (ret == ENGINE_SUCCESS);
       
          if (ret != ENGINE_EWOULDBLOCK) {
              SLAB_INCR(&connection, cmd_set);
      }
      

      I'm not sure the if statement after the state machine makes sense, since under normal circumstances the code will never reach the stat incrementing statement since when it's finished, it will return.

      Instead the stat increment should be within the State::Done step.

      Attachments

        Issue Links

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

          Activity

            People

              thuan Thuan Nguyen
              matt.carabine Matt Carabine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty