Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1533

WT_CURSOR.reset and statistics cursors

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.5.2
    • Labels:

      Description

      A customer reported that a snapshot of the statistics is taken when the cursor is opened, and those values are not re-initialized as part of the WT_CURSOR.reset call.

      I'm not sure if that's right or not, to be honest. The current documentation says only that WT_CURSOR.reset "resets the position" of the cursor, but as I said, I can see how someone might reasonably expect WT_CURSOR.reset to re-initialize the values.

      [~michaelcahill] comments:

      > I can see the argument for having reset on a statistics cursor refresh the values, but what I would actually suggest we do is to lazily refresh a statistics cursor on the first read after a reset (or open).

      > That way, an application can do whatever queries it wants, then reset the cursor and stash it somewhere for as long as it likes. That matches best practice for table and index cursors, which should be reset when queries complete. The next time the application does a read (WT_CURSOR->next or WT_CURSOR->search), the data is refreshed.

      > All of the current uses of statistics cursors I am aware of either do a full scan, then close the cursor, or do a sequence of searches. I don't think that changing the semantics of reset for statistics cursors will cause anyone any trouble, but that needs some investigation before I want to commit to making the change.

        Issue Links

          Activity

          Hide
          sueloverso Sue Loverso added a comment -

          I like Michael's suggestion. It makes sense to me that a statistics cursor->reset resets the values and the next read binds the values to the cursor. Thinking of "position" as "setting the values" is an easy leap.

          Show
          sueloverso Sue Loverso added a comment - I like Michael's suggestion. It makes sense to me that a statistics cursor->reset resets the values and the next read binds the values to the cursor. Thinking of "position" as "setting the values" is an easy leap.
          Hide
          keith.bostic Keith Bostic added a comment -

          Closed with the merge of WT-1734.

          Show
          keith.bostic Keith Bostic added a comment - Closed with the merge of WT-1734 .
          Hide
          ramon.fernandez Ramon Fernandez added a comment -

          Additional ticket information from GitHub

          This ticket was referenced in the following commits:
          Show
          ramon.fernandez Ramon Fernandez added a comment - Additional ticket information from GitHub This ticket was referenced in the following commits: 6d71c851901c74a4adf077f0eda7039d7f68c9a7 1e8c2b89de09462253231213329674b8769d11fe

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 49 weeks, 5 days ago
                Date of 1st Reply: