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

renaming system.views does not correctly invalidate the view catalog

    • Fully Compatible
    • ALL
    • v3.4
    • 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"); })();
    • Storage 2017-08-21
    • 0

      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.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: