diff options
author | Matt Dannenberg <matt.dannenberg@10gen.com> | 2013-05-20 10:37:26 -0400 |
---|---|---|
committer | Matt Dannenberg <matt.dannenberg@10gen.com> | 2013-05-24 09:34:43 -0400 |
commit | e3cc63fd27db5f50304d238dfca7ff431ec5d954 (patch) | |
tree | 6af6dccae7566508b04c06a21e0452fa7263b914 /jstests/replsets/single_server_majority.js | |
parent | 25dd08970a4cf19364fc2ac7bb8f8d03193bffb5 (diff) | |
download | mongo-e3cc63fd27db5f50304d238dfca7ff431ec5d954.tar.gz |
SERVER-7377 support w:majority on solitary server
Diffstat (limited to 'jstests/replsets/single_server_majority.js')
-rw-r--r-- | jstests/replsets/single_server_majority.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/replsets/single_server_majority.js b/jstests/replsets/single_server_majority.js new file mode 100644 index 00000000000..d3417398547 --- /dev/null +++ b/jstests/replsets/single_server_majority.js @@ -0,0 +1,17 @@ +// This test checks that w:"majority" works correctly on a lone mongod + +// set up a mongod and connect a mongo +port = allocatePorts(1)[0]; +var baseName = "single_server_majority"; +var mongod = startMongod("--port", port, "--dbpath", "/data/db/" + baseName); +var mongo = startMongoProgram("mongo", "--port", port); + +// get db and collection, then preform a trivial insert +db = mongo.getDB("test") +col = db.getCollection("single_server_majority"); +col.drop(); +col.save({a: "test"}); + +// see if we can get a majority write on this single server +result = db.getLastErrorObj("majority"); +assert(result.err === null); |