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

Handle adding WT indices while cursors on the table are open

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

      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.

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

              Created:
              Updated:
              Resolved: