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

Handle adding WT indices while cursors on the table are open

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.3, 3.7.1, WT3.1.0
    • Component/s: None
    • Labels:
      None

      Description

      In WiredTiger, we allow adding or dropping indices after a table has been populated. However, there is currently nothing to prevent a cursor being opened on the main table, the schema changed, and the cursor used. This currently gives a memory exception, see the attached test case.

      I don't think we should outright prevent schema changes after a cursor is opened, but we might restrict index add/drop while any cursors are active (implies a cursor reference count on the table). That also feels too restrictive for an active system. It may be reasonable to allow new indices to be added with cursors open, but drops of indices require any cursors on the main table to be closed.

      This was discovered while prototyping cursor caching in WT, as closed cursors can be reused.

        Attachments

          Activity

            People

            Assignee:
            donald.anderson Donald Anderson
            Reporter:
            donald.anderson Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: