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

renaming system.views does not correctly invalidate the view catalog

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      Hide

      (function() {
          'use strict';
          assert.commandWorked(db.createView("view", "coll", []));
          assert.writeOK(db.coll.insert({_id:1}));
          assert.eq(db.view.find().itcount(), 1, "couldn't find document in view");
          assert.commandWorked(db.system.views.renameCollection("views"));
          assert.eq(db.view.find(),itcount(), 0, "find on view should have returned no results after renaming away system.views");
          assert.commandWorked(db.views.renameCollection("system.views"));
          assert.eq(db.view.find(),itcount(), 0, "find on view should have worked again after renaming system.views back in place");
      })();
      

      Show
      (function() { 'use strict'; assert.commandWorked(db.createView("view", "coll", [])); assert.writeOK(db.coll.insert({_id:1})); assert.eq(db.view.find().itcount(), 1, "couldn't find document in view"); assert.commandWorked(db.system.views.renameCollection("views")); assert.eq(db.view.find(),itcount(), 0, "find on view should have returned no results after renaming away system.views"); assert.commandWorked(db.views.renameCollection("system.views")); assert.eq(db.view.find(),itcount(), 0, "find on view should have worked again after renaming system.views back in place"); })();
    • Sprint:
      Storage 2017-08-21
    • Linked BF Score:
      0

      Description

      The onRenameCollection observer does not pass the database name to DurableViewCatalog::onExternalChange, which triggers an invariant in debug builds where we check for correct locking.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: