Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12550

Restore some form of two step (phase) index key insertion

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.6.0-rc3
    • Affects Version/s: 2.5.4
    • Component/s: Index Maintenance
    • Labels:
      None
    • ALL

      v2.4.x has two phase insertion of keys in indexes on inserts. first it descends and finds insertion points in all indexes, then it goes and does the actual key insertions. it was done this way so that as much reading as possible is done before doing a write, as once we mutate something, pagefaultexceptions are no longer possible. i.e. imagine a collection with 10 indexes, after inserting a key in index 1 you can't then PFE on any remaining index lookups.

      for context:

      $ git checkout r2.4.9
      HEAD is now at 52fe0d2... BUMP 2.4.9
      ~/mongo/src/mongo/db$ grep -r twoStep *
      btree.cpp:    void BtreeBucket<V>::twoStepInsert(DiskLoc thisLoc, IndexInsertionContinuationImpl<V> &c,
      btree.h:        void twoStepInsert(DiskLoc thisLoc, IndexInsertionContinuationImpl<V> &c, bool dupsAllowed) const;
      index.cpp:            _idx.head.btree<V>()->twoStepInsert(_idx.head, *continuation, dupsAllowed);
      

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: