[SERVER-31476] Prohibit establishing a $changeStream cursor on a read-only view Created: 09/Oct/17  Updated: 30/Oct/23  Resolved: 21/Nov/17

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Replication
Affects Version/s: 3.5.13
Fix Version/s: 3.6.0-rc5, 3.7.1

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Repl 2017-11-13, Repl 2017-12-04
Participants:

 Description   

The server currently allows something like the following:

db.c.drop();
db.v.drop();
db.c.insert({});
db.createView("v", "c", []);
db.v.aggregate([{$changeStream: {}}]);

However, there is no machinery to produce notifications for changes to a view that occur based on writes to the view's backing collections. As such, notifications will never be delivered to the client for changes to views. Since this use case is not supported, the server should return a clear error message when a user attempts to establish a $changeStream cursor on a view. The current behavior is to establish a $changeStream cursor that will never return any results.



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

Author:

{'name': 'Siyuan Zhou', 'username': 'visualzhou', 'email': 'siyuan.zhou@mongodb.com'}

Message: SERVER-31476 Server should prohibit establishing a cursor on a read-only view

(cherry picked from commit 60929bb3b6c8df3c620f61b09d90c14d64dd31ef)
Branch: v3.6
https://github.com/mongodb/mongo/commit/0c8b1e562ec785d6860c44a8fac700c69a85b023

Comment by Githook User [ 21/Nov/17 ]

Author:

{'name': 'Siyuan Zhou', 'username': 'visualzhou', 'email': 'siyuan.zhou@mongodb.com'}

Message: SERVER-31476 Server should prohibit establishing a cursor on a read-only view
Branch: master
https://github.com/mongodb/mongo/commit/60929bb3b6c8df3c620f61b09d90c14d64dd31ef

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