summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2015-01-05 11:55:14 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2015-01-05 13:42:57 -0500
commit780c6856b83168f17c2015fb8f8547e223eadf53 (patch)
tree5458508f6fe820c3bce37ec73fc5ea8faa5b0113 /jstests
parent57620924289aff41175c71d06ab27c0c7c8c7ead (diff)
downloadmongo-780c6856b83168f17c2015fb8f8547e223eadf53.tar.gz
SERVER-16660 sharding_system_namespaces.js incorrectly assumes that mongod supports wiredTiger
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/sharding_system_namespaces.js69
1 files changed, 34 insertions, 35 deletions
diff --git a/jstests/sharding/sharding_system_namespaces.js b/jstests/sharding/sharding_system_namespaces.js
index fccc97442a4..ed1f3ac578d 100644
--- a/jstests/sharding/sharding_system_namespaces.js
+++ b/jstests/sharding/sharding_system_namespaces.js
@@ -1,9 +1,6 @@
-// TODO: This test incorrectly assumes that wiredTiger is compiled into the server. SERVER-16660.
-
-/*
// SERVER-16498 d_migrate.cpp should not rely on system.namespaces
//
-// This test create a sharded collection with wiredtiger options.
+// This test creates a sharded collection with wiredtiger options.
// When the chunks of this collection get migrated to the other shard,
// the other shard should create the collection with the same options.
// However, before SERVER-16498, the receiver relies on checking
@@ -19,43 +16,45 @@ var st = new ShardingTest({ shards : 2 });
var db = st.s.getDB("test");
var coll = db.sharding_system_namespaces;
-function checkCollectionOptions(database) {
- var collectionsInfos = database.getCollectionInfos();
- printjson(collectionsInfos);
- var info = collectionsInfos.filter(function(c) {
- return c.name == "sharding_system_namespaces";
- })[0];
- assert.eq(info.options.storageEngine.wiredTiger.configString, "block_compressor=zlib");
-}
+if (db.serverBuildInfo().bits != 32) {
-db.createCollection("sharding_system_namespaces",
-{
- storageEngine: {
- wiredTiger: { configString: "block_compressor=zlib" }
- }
-});
+ function checkCollectionOptions(database) {
+ var collectionsInfos = database.getCollectionInfos();
+ printjson(collectionsInfos);
+ var info = collectionsInfos.filter(function(c) {
+ return c.name == "sharding_system_namespaces";
+ })[0];
+ assert.eq(info.options.storageEngine.wiredTiger.configString, "block_compressor=zlib");
+ }
-checkCollectionOptions(db);
+ db.createCollection("sharding_system_namespaces",
+ {
+ storageEngine: {
+ wiredTiger: { configString: "block_compressor=zlib" }
+ }
+ });
-assert.commandWorked(db.adminCommand({ enableSharding: 'test' }));
-assert.commandWorked(db.adminCommand({ shardCollection: coll + '', key: { x: 1 }}));
+ checkCollectionOptions(db);
-coll.insert({x: 0});
-coll.insert({x: 10});
+ assert.commandWorked(db.adminCommand({ enableSharding: 'test' }));
+ assert.commandWorked(db.adminCommand({ shardCollection: coll + '', key: { x: 1 }}));
-assert.commandWorked(db.adminCommand({ split: coll + '', middle: { x: 5 }}));
+ coll.insert({x: 0});
+ coll.insert({x: 10});
-printShardingStatus();
+ assert.commandWorked(db.adminCommand({ split: coll + '', middle: { x: 5 }}));
-var primaryShard = st.getServer("test");
-anotherShard = st.getOther( primaryShard );
-assert.commandWorked(db.adminCommand({
- movechunk: coll + '',
- find: { x: 5 },
- to: anotherShard.name
-}));
+ printShardingStatus();
-printShardingStatus();
+ var primaryShard = st.getServer("test");
+ anotherShard = st.getOther( primaryShard );
+ assert.commandWorked(db.adminCommand({
+ movechunk: coll + '',
+ find: { x: 5 },
+ to: anotherShard.name
+ }));
-checkCollectionOptions(anotherShard.getDB("test"));
-*/
+ printShardingStatus();
+
+ checkCollectionOptions(anotherShard.getDB("test"));
+}