-
Type: Bug
-
Resolution: Duplicate
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
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:
- http://docs.mongodb.org/manual/reference/command/fsync/
- http://docs.mongodb.org/manual/reference/method/db.fsyncLock/
Is it possible to document this behaviour in either/both of those locations?
- duplicates
-
DOCS-9265 3.4: Clarify multiple fsyncLock behavior
- Closed