[DOCS-3838] unclear locking behavior when repairing a database Created: 29/Jul/14  Updated: 05/Sep/14  Resolved: 05/Sep/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.10

Type: Bug Priority: Major - P3
Reporter: Aaron Westendorf Assignee: Tim Slavin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-14716 tab-complete blocks under global lock... Closed
is related to SERVER-14721 remove global lock from repairDatabas... Closed
Participants:
Days since reply: 9 years, 25 weeks, 4 days ago

 Description   

The documentation on locking during a database repair is ambiguous.

http://docs.mongodb.org/manual/reference/command/repairDatabase/

The command documentation implies a global lock is obtained. This alone is unclear because it's not obvious if this was updated after per-database locks were implemented.

To clear up confusion, a user may find themselves on this page, which very strongly implies that repairing a database will only hold the lock on the database being repaired, not the "database" as in the whole process.

http://docs.mongodb.org/manual/faq/concurrency/#which-administrative-commands-lock-the-database

I just attempted to repair a database on a 2.6 replica set secondary and all operations across all databases were blocked.



 Comments   
Comment by Githook User [ 23/Aug/14 ]

Author:

{u'username': u'TimSlavinMongoDB', u'name': u'Tim Slavin (MongoDB)', u'email': u'tim.slavin@10gen.com'}

Message: DOCS-3838: unclear locking behavior when repairing a database

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/562bd4c598f622fd4bae8457d6cffd7fd6a309cc

Comment by Thomas Rueckstiess [ 29/Jul/14 ]

Hi Aaron,

The term "global lock" has always referred to the instance-wide lock covering all databases. Version 2.2. introduced "database-level locks" and the operations that only lock per database refer to the term "database-level lock" or "db lock". You can also find some more details on our Documentation page How Granular are Locks in MongoDB.

The documentation of the repairDatabase command is correct in stating the global lock.

The list of operations in the section Does a MongoDB operation ever lock more than one database? is missing an entry for repairDatabase. Thanks for pointing this out, I'm going to move this ticket over to the DOCS project, as this is currently "Works as Designed" for the server.

I hope this clears up the confusion around global vs. database-level locks, and why the repair blocked operations on other databases as well.

Regards,
Thomas

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