-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.1.4
-
Component/s: MongoDB 3.2
-
Environment:Mac OSX 10.11.6 and Ubuntu 16.04
-
Empty show more show less
I need to lock and unlock the database in order to automate snapshot backups with Node.js. The "fsync lock" command in the code sample below works fine but then the following fsyncUnlock operation hangs (it does not return any errors or any results and does not unlock the database). But if I run the same db.fsyncUnlock() in Mongodb shell the code below instantly stops hanging and returns
{"ok":0,"errmsg":"not locked"}. So, the bug is that the node driver fails to execute fsyncUnlock and hangs for no good reason.
MongoClient.connect(connectionString, function(err, connection){
if (err) throw (err);
connection.command(
,function(err){
if (err) throw (err);
// Block storage snapshot happens here
connection.eval("db.fsyncUnlock();", function (err)
);
});
});