[SERVER-33382] GlobalCursorIdCache::timeoutCursors() sometimes sees a view, resulting in a crash Created: 16/Feb/18  Updated: 29/Oct/23  Resolved: 20/Feb/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Bug Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2018-02-26
Participants:
Linked BF Score: 0

 Description   

When the CursorIdCache::timeoutCursors() iterates over its cursors, it locks them using an AutoGetCollectionForReadCommand title that will uassert when locking a view.

There should not be a view among the cursors managed by CursorIdCache, but timeoutCursors() does not hold the lock while it iterates, so there is a window of time during which a collection can be dropped and replaced by a view with the same name. Because the uassert occurs as part of the cursor cleanup background job, it crashes the server.



 Comments   
Comment by Githook User [ 20/Feb/18 ]

Author:

{'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster', 'username': 'jseyster'}

Message: SERVER-33382 Permit views in GlobalCursorIdCache::timeoutCursors().
Branch: master
https://github.com/mongodb/mongo/commit/d01dc284473c0b91513d0200f4b1b5aa682c08e6

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