Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-870

Unable to run both fsyncLock and fsyncUnlock through Node driver

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.1.4
    • Component/s: MongoDB 3.2
    • Labels:
    • Environment:
      Mac OSX 10.11.6 and Ubuntu 16.04

      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(

      { fsync: 1, lock: true }

      ,function(err){
      if (err) throw (err);
      // Block storage snapshot happens here
      connection.eval("db.fsyncUnlock();", function (err)

      { if (err) throw (err); }

      );
      });
      });

            Assignee:
            Unassigned Unassigned
            Reporter:
            dennis.kashkin@gmail.com Dennis Kashkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: