[SERVER-42373] Prevent "invalid view definition" error while dropping nonexistent collection Created: 24/Jul/19  Updated: 29/Oct/23  Resolved: 20/Sep/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.4.21, 3.6.13, 4.0.10, 4.1.13, 4.2.0-rc4
Fix Version/s: 4.2.1, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Gantt Dependency
has to be done before SERVER-42000 Remove blacklist for invalid_system_v... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Steps To Reproduce:

The sharding continuous stepdown suite happens to have perfect conditions to reproduce this. However, this should also happen in an unsharded system.

Simply change this line to if(true) to simulate a scenario where we are trying to drop a collection that has already been dropped.

Sprint: Execution Team 2019-09-23
Participants:
Linked BF Score: 15

 Description   

In a world where an invalid view exists in the view catalog for a database:

Concurrent dropCollections for the same namespace will fail due to an invalid view definition. If a collection is successfully dropped the first time, the happy path will not conflict with the view catalog. The second time, since we don't find the collection in the catalog, we assume that we have a view instead. We attempt to look up said view, causing the invalid view definition error even if said view doesn't exist.

This behavior breaks the invalid system views contract, which is that an invalid view in the view catalog should not interfere with attempting to run operations on unrelated collections.

It's possible just to make a first pass through the view catalog to verify if a view exists without validating durable views, then to make another pass with validation on if the view does indeed exist.



 Comments   
Comment by Githook User [ 14/Oct/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-42373 Prevent "invalid view definition" error while dropping nonexistent collection

(cherry picked from commit 00bd5405dfaa44f3094965cf6bb0e6dc55062b99)
Branch: v4.2
https://github.com/mongodb/mongo/commit/3135b6a77d4fbabccc113186817ba670e31d13b6

Comment by Githook User [ 20/Sep/19 ]

Author:

{'name': 'Haley Connelly', 'username': 'haleyConnelly', 'email': 'haley.connelly@10gen.com'}

Message: SERVER-42373 Prevent "invalid view definition" error while dropping nonexistent collection
Branch: master
https://github.com/mongodb/mongo/commit/00bd5405dfaa44f3094965cf6bb0e6dc55062b99

Comment by Eric Milkie [ 06/Sep/19 ]

We should fix this issue long-term by prohibiting writes to system.views.
The short term fix for the fuzzer failures is to avoid the invalid view definition error for this code path.

Comment by Eric Milkie [ 26/Jul/19 ]

We should brainstorm solutions to this issue.

Generated at Thu Feb 08 05:00:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.