diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-01-31 08:32:52 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-01-31 08:32:52 +0100 |
commit | 4eefaf421bfeddf040d96a3dafb12e09673423d7 (patch) | |
tree | cb2e5ccc7f98158894f977ff131949da36673591 /jstests/fsync.js | |
download | mongodb-4eefaf421bfeddf040d96a3dafb12e09673423d7.tar.gz |
Imported Upstream version 1.3.1
Diffstat (limited to 'jstests/fsync.js')
-rw-r--r-- | jstests/fsync.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/fsync.js b/jstests/fsync.js new file mode 100644 index 0000000..fccd623 --- /dev/null +++ b/jstests/fsync.js @@ -0,0 +1,22 @@ +// test the lock/unlock snapshotting feature a bit + +x=db.runCommand({fsync:1,lock:1}); +assert(!x.ok,"D"); + +d=db.getSisterDB("admin"); + +x=d.runCommand({fsync:1,lock:1}); + +assert(x.ok,"C"); + +y = d.currentOp(); +assert(y.fsyncLock,"B"); + +z = d.$cmd.sys.unlock.findOne(); + +// 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. +db.jstests_fsync.insert({x:1}); + +assert( d.currentOp().fsyncLock == null, "A" ); + |