[DOCS-13595] Investigate changes in SERVER-35804: Disallow dropping collections under config/admin via mongos Created: 15/Apr/20  Updated: 13/Nov/23  Resolved: 29/Jul/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.7.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Naomi Pentrel (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-35804 Disallow dropping collections under c... Closed
Participants:
Days since reply: 2 years, 28 weeks ago
Epic Link: DOCSP-9747

 Description   

Description

Downstream Change Summary

This ticket makes it such that attempting to drop collections under the admin or config database through mongos will now throw an error. Attempting to call dropDatabase on admin or config will similarly throw an error. It is still possible to drop these collections when connecting directly to the config server.

Description of Linked Ticket

This ticket makes it such that attempting to drop collections under the admin or config database through mongos will now throw an error. Attempting to call dropDatabase on admin or config will similarly throw an error. It is still possible to drop these collections when connecting directly to the config server.

Original Description:

_configsvrDropCollection calls lockWithSessionID() which sets the readSource to be kMajorityCommitted and all the following commands from _configsvrDropCollection would erroneously keep using kMajorityCommitted as the readSource.

Here is what happened in BF-9590:
1. The config primary server got _configsvrDropCollection command.
2. The distributed lock manager ran lockWithSessionID which triggered a majority read, so the readSource of the WiredTigerRecoveryUnit was set to 'majority'.
3. There was another thread which just finished adding an index to the collection "admin.mod1"
4. _configsvrDropCollection finally called dropCollection which did a check whether the numbers of indexes on disk and in memory were equal. Since the readSource was still "majority", we read the on-disk catalog with "majority" timestamp when the change to index catalog was not made yet. But the in-memory index catalog has the new index.

Update:
_configsvrDropCollection() finally called dropCollection() because the collection is in admin database whose primary shard is the config server itself.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 28/Jul/21 ]

Author:

{'name': 'Naomi Pentrel', 'email': '5212232+npentrel@users.noreply.github.com', 'username': 'npentrel'}

Message: DOCS-13595: Disallow dropping admin/config mongos
Branch: master
https://github.com/mongodb/docs/commit/5671ba4f64803ecca18bbf3fd77b5065f0b0f132

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