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

Unable to run both fsyncLock and fsyncUnlock through Node driver

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: None
    • Component/s: MongoDB 3.2
    • Environment:
      Mac OSX 10.11.6 and Ubuntu 16.04

      Description

      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); }

      );
      });
      });

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: