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

stats for key are not defined in documentation, many stats are not defined

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.7.2, 1.8.0, 2.0-developer-preview-4
    • Fix Version/s: 2.0-beta
    • Component/s: None
    • Security Level: Public
    • Labels:
      None
    • Flagged:
      Impediment

      Description

      To work through the implementation of OBSERVE[1], we were looking for the details on STATS KEY, only to find it's not documented. It exists in the server implementation, but it's not even in the stats.org[2] associated with the code repository.

      This statistic and all others that are public interface should be documented in the manual.

      Implementation of OBSERVE operations in the various client libraries will need this information.

      1. http://www.couchbase.com/wiki/display/couchbase/Observe
      2. https://github.com/couchbase/ep-engine/blob/master/docs/stats.org

      # Subject Project Status CR V
      For Gerrit Dashboard: &For+MB-5304=message:MB-5304

        Activity

        Hide
        dipti Dipti Borkar added a comment -

        Chiyoung, can you provide details on stats key so that documentation can be added?

        Show
        dipti Dipti Borkar added a comment - Chiyoung, can you provide details on stats key so that documentation can be added?
        Hide
        chiyoung Chiyoung Seo added a comment -

        Jin,

        We should provide the "stats key" documentation for the client library team, so that they can refer to this documentation to implement OBSERVE command in the client libraries.

        Show
        chiyoung Chiyoung Seo added a comment - Jin, We should provide the "stats key" documentation for the client library team, so that they can refer to this documentation to implement OBSERVE command in the client libraries.
        Hide
        chiyoung Chiyoung Seo added a comment -

        Assign it to Mike as he was mainly involved in the initial OBSERVE design.

        Show
        chiyoung Chiyoung Seo added a comment - Assign it to Mike as he was mainly involved in the initial OBSERVE design.
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-ep-engine-2-0 #301 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/301/)
        MB-5304: Document stats key/vkey in stats.org (Revision df4dd0f9aa65b69a36a304ca76a8389090bd3297)

        Result = SUCCESS
        Mike Wiederhold :
        Files :

        • docs/stats.org
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-ep-engine-2-0 #301 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/301/ ) MB-5304 : Document stats key/vkey in stats.org (Revision df4dd0f9aa65b69a36a304ca76a8389090bd3297) Result = SUCCESS Mike Wiederhold : Files : docs/stats.org
        Hide
        ingenthr Matt Ingenthron added a comment - - edited

        Documentation mixes stats key and stats vkey, though the return values for each need to be understood. Also, see MB-5435. This documentation appears to be wrong with respect to the key valid field, or there's some subtlety that is not explained by the table.

        Show
        ingenthr Matt Ingenthron added a comment - - edited Documentation mixes stats key and stats vkey, though the return values for each need to be understood. Also, see MB-5435 . This documentation appears to be wrong with respect to the key valid field, or there's some subtlety that is not explained by the table.
        Hide
        mikew Mike Wiederhold added a comment -

        Stats key and vkey return the same data. The only difference is the key_valid field returned by stats vkey. I have marked each stat with the command that returns it in the column on the left. I made a few minor wording changes to the documentation, but I disagree that the documentation is wrong. Please provide an explanation of what is confusing or contact me over Skype to discuss anything you think is incorrect.

          • Stats Key and Vkey
            key_cas The keys current cas value KV
            key_data_age How long the key has waited for its KV
              value to be persisted (0 if clean) KV
            key_exptime Expiration time from the epoch KV
            key_flags Flags for this key KV
            key_is_dirty If the value is not yet persisted KV
            key_last_modified_time Last updated time KV
            key_valid See description below V
            key_vb_state The vbucket state of this key KV

        =key_valid= can have the following responses:

        this_is_a_bug - Some case we didn't take care of.
        dirty - The value in memory has not been persisted yet.
        length_mismatch - Data length in memory doesn't match the data length on disk.
        data_mismatch - The data in memory doesn't match the data on disk.
        flags_mismatch - The flags in memory don't match the flags on disk.
        valid - The data on disk and in memory match
        ram_but_not_disk - The value doesn't exist yet on disk.
        item_deleted - The item has been deleted.

        Show
        mikew Mike Wiederhold added a comment - Stats key and vkey return the same data. The only difference is the key_valid field returned by stats vkey. I have marked each stat with the command that returns it in the column on the left. I made a few minor wording changes to the documentation, but I disagree that the documentation is wrong. Please provide an explanation of what is confusing or contact me over Skype to discuss anything you think is incorrect. Stats Key and Vkey key_cas The keys current cas value KV key_data_age How long the key has waited for its KV   value to be persisted (0 if clean) KV key_exptime Expiration time from the epoch KV key_flags Flags for this key KV key_is_dirty If the value is not yet persisted KV key_last_modified_time Last updated time KV key_valid See description below V key_vb_state The vbucket state of this key KV =key_valid= can have the following responses: this_is_a_bug - Some case we didn't take care of. dirty - The value in memory has not been persisted yet. length_mismatch - Data length in memory doesn't match the data length on disk. data_mismatch - The data in memory doesn't match the data on disk. flags_mismatch - The flags in memory don't match the flags on disk. valid - The data on disk and in memory match ram_but_not_disk - The value doesn't exist yet on disk. item_deleted - The item has been deleted.
        Hide
        avsej Sergey Avseyev added a comment -

        What is KV in the last column? I think it should be KV instead of V for key_valid

        Show
        avsej Sergey Avseyev added a comment - What is KV in the last column? I think it should be KV instead of V for key_valid
        Hide
        mikew Mike Wiederhold added a comment -

        K = Key
        V = VKey

        And key_valid is not included in stats key.

        Show
        mikew Mike Wiederhold added a comment - K = Key V = VKey And key_valid is not included in stats key.
        Hide
        avsej Sergey Avseyev added a comment -

        What does mean "is not included in stats"? I can have key "x" with value "test" in the default bucket on couchbase 2.0. Here is the output of the command line tools:

        $ cbc cat x
        "x" Size 5 Flags 0x0 CAS 0x69cf70ff8de90000
        test
        $ curl -s http://localhost:8091/pools/default/buckets/default | vbuckettool - x
        key: x master: 127.0.0.1:11210 vBucketId: 220 couchApiBase: http://127.0.0.1:8092/default replicas:
        $ cbc stats "key x 220"
        127.0.0.1:11210 key_is_dirty 0
        127.0.0.1:11210 key_exptime 0
        127.0.0.1:11210 key_flags 0
        127.0.0.1:11210 key_cas 256796085243753
        127.0.0.1:11210 key_dirtied 0
        127.0.0.1:11210 key_data_age 0
        127.0.0.1:11210 key_last_modification_time 1338826758
        $ cbc stats "vkey x 220"
        127.0.0.1:11210 key_is_dirty 0
        127.0.0.1:11210 key_exptime 0
        127.0.0.1:11210 key_flags 0
        127.0.0.1:11210 key_cas 256796085243753
        127.0.0.1:11210 key_dirtied 0
        127.0.0.1:11210 key_data_age 0
        127.0.0.1:11210 key_last_modification_time 1338826854
        127.0.0.1:11210 key_valid valid

        You can see the last line says there is key "key_valid" and value "valid"

        Show
        avsej Sergey Avseyev added a comment - What does mean "is not included in stats"? I can have key "x" with value "test" in the default bucket on couchbase 2.0. Here is the output of the command line tools: $ cbc cat x "x" Size 5 Flags 0x0 CAS 0x69cf70ff8de90000 test $ curl -s http://localhost:8091/pools/default/buckets/default | vbuckettool - x key: x master: 127.0.0.1:11210 vBucketId: 220 couchApiBase: http://127.0.0.1:8092/default replicas: $ cbc stats "key x 220" 127.0.0.1:11210 key_is_dirty 0 127.0.0.1:11210 key_exptime 0 127.0.0.1:11210 key_flags 0 127.0.0.1:11210 key_cas 256796085243753 127.0.0.1:11210 key_dirtied 0 127.0.0.1:11210 key_data_age 0 127.0.0.1:11210 key_last_modification_time 1338826758 $ cbc stats "vkey x 220" 127.0.0.1:11210 key_is_dirty 0 127.0.0.1:11210 key_exptime 0 127.0.0.1:11210 key_flags 0 127.0.0.1:11210 key_cas 256796085243753 127.0.0.1:11210 key_dirtied 0 127.0.0.1:11210 key_data_age 0 127.0.0.1:11210 key_last_modification_time 1338826854 127.0.0.1:11210 key_valid valid You can see the last line says there is key "key_valid" and value "valid"
        Hide
        avsej Sergey Avseyev added a comment - - edited

        I see now sorry. VKey. So I have no objections any more

        Show
        avsej Sergey Avseyev added a comment - - edited I see now sorry. VKey. So I have no objections any more
        Hide
        mikew Mike Wiederhold added a comment -

        Sergey appears to be okay with the documentation. PLease reopen if any other issues come up.

        Show
        mikew Mike Wiederhold added a comment - Sergey appears to be okay with the documentation. PLease reopen if any other issues come up.
        Hide
        ingenthr Matt Ingenthron added a comment -

        My confusion too was based on the last column. Could we clarify that (if not done already)? I thought you were saying whether or not each stat returned a key and value for the stat.

        Show
        ingenthr Matt Ingenthron added a comment - My confusion too was based on the last column. Could we clarify that (if not done already)? I thought you were saying whether or not each stat returned a key and value for the stat.

          People

          • Assignee:
            mikew Mike Wiederhold
            Reporter:
            ingenthr Matt Ingenthron
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes