mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
23 lines
489 B
JavaScript
23 lines
489 B
JavaScript
// 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" );
|
|
|