[SERVER-40712] Clarify the behaviour of `db.dropDatabase` and the `dropDatabase` command Created: 18/Apr/19  Updated: 29/Oct/23  Resolved: 14/May/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.12, 4.0.27

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Documented
is documented by DOCS-12700 Docs for SERVER-40712: Clarify the be... Closed
Related
is related to SERVER-34776 dropDatabase should respect user prov... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2019-05-20
Participants:
Linked BF Score: 0

 Description   

The drop database command and shell helper are both documented as accepting write concern, but reading through the code and testing them seems to disagree with the documentation.

Specifically:

  • From the shell code it looks like db.dropDatabase does not allow any parameters. So how does one specify majority write concern through the shell helper?
  • Executing the dropDatabase command directly, without passing write concern seems to always result in a w:majority behaviour. In particular, daniel.hatcher performed these repro steps: "3 member replica set, fyncLocked 2 of the members, command hung on primary".

I am filing this ticket to request clarification on the behaviour of the dropDatabase command and shell helper and to have the documentation updated.



 Comments   
Comment by Githook User [ 10/Aug/21 ]

Author:

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

Message: SERVER-40712 Ensure the dropDatabase() command accepts a write concern.

(cherry picked from commit cfd65015b39fe7b0db6aec288f69163bc5763812)
Branch: v4.0
https://github.com/mongodb/mongo/commit/313c570210a23b26082dc00ea74112131c4c7e33

Comment by Githook User [ 14/May/19 ]

Author:

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

Message: SERVER-40712 Ensure the dropDatabase() command accepts a write concern.
Branch: master
https://github.com/mongodb/mongo/commit/cfd65015b39fe7b0db6aec288f69163bc5763812

Comment by Eric Milkie [ 18/Apr/19 ]

Also it's not really a "default", it's more like the "minimum". If a user specifies a write concern, it is waited for in conjunction with w:majority.

Comment by Eric Milkie [ 18/Apr/19 ]

That is correct. It's like the other commands that have this default, such as the user authorization modification commands.

Comment by Kaloian Manassiev [ 18/Apr/19 ]

To what does the write concern default for this command if not specified? Looks like it defaults to majority, at least from Danny's repro.

Comment by Eric Milkie [ 18/Apr/19 ]

I linked in the ticket where we enabled write-concern for this command.  It sounds like we may have to fix up the shell helper and documentation.

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