[DOCS-5976] fsyncLock documentation does not discuss behaviour of multiple locks Created: 05/Aug/15  Updated: 30/Oct/23  Resolved: 29/Mar/18

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Critical - P2
Reporter: Victor Hooi Assignee: Kay Kim (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DOCS-9265 3.4: Clarify multiple fsyncLock behav... Closed
Participants:
Days since reply: 5 years, 45 weeks, 6 days ago

 Description   

If you issue multiple calls to db.fsyncLock, each invocation takes a separate lock, and you need to ensure you pair an exact number (or greater number) of matching db.fsyncUnlock commands to unlock things.

This is not necessarily intuitive behaviour - many people might assume there are only two states - locked and unlocked, and that multiple calls to db.fsyncLock whilst locked are simply idempotent (and similarly for db.fsyncUnclock).

The output of the commands also doesn't give any clues about this behaviour either:

> db.fsyncLock()
{
        "info" : "now locked against writes, use db.fsyncUnlock() to unlock",
        "seeAlso" : "http://dochub.mongodb.org/core/fsynccommand",
        "ok" : 1
}

> db.fsyncUnlock()
{ "ok" : 1, "info" : "unlock completed" }

Nor is it mentioned on either the documentation for fsync or db.fsyncLock:

Is it possible to document this behaviour in either/both of those locations?



 Comments   
Comment by Githook User [ 29/Mar/18 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'kay', 'username': 'kay-kim'}

Message: DOCS-9265, DOCS-5976: fsyncLock/Unlock and lock counts
Branch: v3.4
https://github.com/mongodb/docs/commit/deb8aa5bb4731f46c6d93b45acc723d79c4b4c21

Comment by Githook User [ 29/Mar/18 ]

Author:

{'email': 'kay.kim@10gen.com', 'name': 'kay', 'username': 'kay-kim'}

Message: DOCS-9265, DOCS-5976: fsyncLock/Unlock and lock counts
Branch: master
https://github.com/mongodb/docs/commit/de4e26dc99160a8e5024b5d7810dcd45089dc79a

Comment by Kay Kim (Inactive) [ 29/Mar/18 ]

Will do as part of 9265

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