diff options
author | gregs <greg@10gen.com> | 2012-06-09 15:08:52 -0400 |
---|---|---|
committer | gregs <greg@10gen.com> | 2012-06-09 15:08:52 -0400 |
commit | ccd568b6e292b4641f60c704ddf983240e8f23a4 (patch) | |
tree | 10eacfb1d71f1d7afdfbf434fbe58065e1669464 /jstests | |
parent | 2deb6a2f1b457adc58436f11dd730d1fcc525084 (diff) | |
download | mongo-ccd568b6e292b4641f60c704ddf983240e8f23a4.tar.gz |
Revert "SERVER-4262 test that invalid writes are detected even when mongos initially stale"
This reverts commit a65d2bc01f263ccefc1a7392f48b362338c83daf.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/mongos_validate_writes.js | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/jstests/sharding/mongos_validate_writes.js b/jstests/sharding/mongos_validate_writes.js deleted file mode 100644 index 0bab919f280..00000000000 --- a/jstests/sharding/mongos_validate_writes.js +++ /dev/null @@ -1,91 +0,0 @@ -// -// Tests that mongos validating writes when stale does not DOS config servers -// -// Note that this is *unsafe* with broadcast removes and updates -// - -var st = new ShardingTest({ shards : 2, mongos : 3, other : { separateConfig : true } }) -st.stopBalancer() - -var mongos = st.s0 -var staleMongosA = st.s1 -var staleMongosB = st.s2 - -var admin = mongos.getDB( "admin" ) -var config = mongos.getDB( "config" ) -var coll = mongos.getCollection( "foo.bar" ) -var staleCollA = staleMongosA.getCollection( coll + "" ) -var staleCollB = staleMongosB.getCollection( coll + "" ) - -printjson( admin.runCommand({ enableSharding : coll.getDB() + "" }) ) -coll.ensureIndex({ a : 1 }) -printjson( admin.runCommand({ shardCollection : coll + "", key : { a : 1 } }) ) - -// Let the stale mongos see the collection state -staleCollA.findOne() -staleCollB.findOne() - -// Change the collection sharding state -coll.drop() -coll.ensureIndex({ b : 1 }) -printjson( admin.runCommand({ shardCollection : coll + "", key : { b : 1 } }) ) - -// Make sure that we can successfully insert, even though we have stale state -staleCollA.insert({ b : "b" }) -assert.eq( null, staleCollA.getDB().getLastError() ) - -// Make sure we unsuccessfully insert with old info -staleCollB.insert({ a : "a" }) -assert.neq( null, staleCollB.getDB().getLastError() ) - -// Change the collection sharding state -coll.drop() -coll.ensureIndex({ c : 1 }) -printjson( admin.runCommand({ shardCollection : coll + "", key : { c : 1 } }) ) - -// Make sure we can successfully upsert, even though we have stale state -staleCollA.update({ c : "c" }, { c : "c" }, true ) -assert.eq( null, staleCollA.getDB().getLastError() ) - -// Make sure we unsuccessfully upsert with old info -staleCollB.update({ b : "b" }, { b : "b" }, true ) -assert.neq( null, staleCollB.getDB().getLastError() ) - -// Change the collection sharding state -coll.drop() -coll.ensureIndex({ d : 1 }) -printjson( admin.runCommand({ shardCollection : coll + "", key : { d : 1 } }) ) - -// Make sure we can successfully update, even though we have stale state -coll.insert({ d : "d" }) - -staleCollA.update({ d : "d" }, { $set : { x : "x" } }, false, false ) -assert.eq( null, staleCollA.getDB().getLastError() ) -assert.eq( staleCollA.findOne().x, "x" ) - -// Make sure we unsuccessfully update with old info -staleCollB.update({ c : "c" }, { $set : { x : "y" } }, false, false ) -assert.neq( null, staleCollB.getDB().getLastError() ) -assert.eq( staleCollB.findOne().x, "x" ) - -// Change the collection sharding state -coll.drop() -coll.ensureIndex({ e : 1 }) -// Deletes need to be across two shards to trigger an error - this is probably an exceptional case -printjson( admin.runCommand({ movePrimary : coll.getDB() + "", to : "shard0000" }) ) -printjson( admin.runCommand({ shardCollection : coll + "", key : { e : 1 } }) ) -printjson( admin.runCommand({ split : coll + "", middle : { e : 0 } }) ) -printjson( admin.runCommand({ moveChunk : coll + "", find : { e : 0 }, to : "shard0001" }) ) - -// Make sure we can successfully remove, even though we have stale state -coll.insert({ e : "e" }) - -staleCollA.remove({ e : "e" }, true) -assert.eq( null, staleCollA.getDB().getLastError() ) -assert.eq( null, staleCollA.findOne() ) - -// Make sure we unsuccessfully remove with old info -staleCollB.remove({ d : "d" }, true ) -assert.neq( null, staleCollB.getDB().getLastError() ) - -st.stop() |