diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
commit | 5d342a758c6095b4d30aba0750b54f13b8916f51 (patch) | |
tree | 762e9aa84781f5e3b96db2c02d356c29cf0217c0 /jstests/fsync.js | |
parent | cbe2d992e9cd1ea66af9fa91df006106775d3073 (diff) | |
download | mongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz |
Imported Upstream version 2.0.0
Diffstat (limited to 'jstests/fsync.js')
-rw-r--r-- | jstests/fsync.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/jstests/fsync.js b/jstests/fsync.js index fccd623..134d558 100644 --- a/jstests/fsync.js +++ b/jstests/fsync.js @@ -1,22 +1,21 @@ // test the lock/unlock snapshotting feature a bit -x=db.runCommand({fsync:1,lock:1}); +x=db.runCommand({fsync:1,lock:1}); // not on admin db assert(!x.ok,"D"); -d=db.getSisterDB("admin"); - -x=d.runCommand({fsync:1,lock:1}); +x=db.fsyncLock(); // uses admin automatically assert(x.ok,"C"); -y = d.currentOp(); +y = db.currentOp(); assert(y.fsyncLock,"B"); -z = d.$cmd.sys.unlock.findOne(); +z = db.fsyncUnlock(); +assert( db.currentOp().fsyncLock == null, "A2" ); -// it will take some time to unlock, and unlock does not block and wait for that -// doing a write will make us wait until db is writeable. +// make sure the db is unlocked db.jstests_fsync.insert({x:1}); +db.getLastError(); -assert( d.currentOp().fsyncLock == null, "A" ); +assert( db.currentOp().fsyncLock == null, "A" ); |