[SERVER-30406] renaming system.views does not correctly invalidate the view catalog Created: 28/Jul/17  Updated: 30/Oct/23  Resolved: 31/Jul/17

Status: Closed
Project: Core Server
Component/s: Querying, Storage
Affects Version/s: None
Fix Version/s: 3.4.11, 3.5.11

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Steps To Reproduce:

(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
Participants:
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.



 Comments   
Comment by Githook User [ 01/Nov/17 ]

Author:

{'name': 'Geert Bosch', 'username': 'GeertBosch', 'email': 'geert@mongodb.com'}

Message: SERVER-30406 Test view catalog invalidation due to renaming to/from system.views

(cherry picked from commit e3bdbd02624f5dce42aada11b84f28ff14f578da)

Conflicts:
src/mongo/db/op_observer_impl.cpp
Branch: v3.4
https://github.com/mongodb/mongo/commit/8d99028a306bfb1fe5a7734e2f1926c06e2defbe

Comment by Githook User [ 31/Jul/17 ]

Author:

{'email': 'geert@mongodb.com', 'username': 'GeertBosch', 'name': 'Geert Bosch'}

Message: SERVER-30406 Test view catalog invalidation due to renaming to/from system.views
Branch: master
https://github.com/mongodb/mongo/commit/e3bdbd02624f5dce42aada11b84f28ff14f578da

Generated at Thu Feb 08 04:23:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.