summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2018-08-27 13:06:38 -0400
committerDianna Hohensee <dianna.hohensee@10gen.com>2018-08-29 16:47:09 -0400
commit4cb0742947dabee476c9979cae39c728a21568d5 (patch)
tree8ec6baacaab48a11b20eae4781f32be1bdad6ec2 /jstests
parentaa36a9e8ad8c98e828f1b53966672b368d973380 (diff)
downloadmongo-4cb0742947dabee476c9979cae39c728a21568d5.tar.gz
SERVER-36015 Remove references to system.namespaces and system.indexes
Diffstat (limited to 'jstests')
-rw-r--r--jstests/auth/basic_role_auth.js7
-rw-r--r--jstests/auth/clac_system_colls.js9
-rw-r--r--jstests/auth/indexSystemUsers.js4
-rw-r--r--jstests/auth/lib/commands_lib.js121
-rw-r--r--jstests/core/apply_ops1.js135
-rw-r--r--jstests/core/apply_ops_index_collation.js62
-rw-r--r--jstests/core/batch_write_command_insert.js141
-rw-r--r--jstests/core/cannot_create_system_dot_indexes.js51
-rw-r--r--jstests/core/indexOtherNamespace.js19
-rw-r--r--jstests/core/indexapi.js4
-rw-r--r--jstests/core/indexes_on_indexes.js25
-rw-r--r--jstests/core/list_collections1.js14
-rw-r--r--jstests/core/list_collections_filter.js8
-rw-r--r--jstests/core/list_collections_no_views.js12
-rw-r--r--jstests/core/list_indexes_invalidation.js1
-rw-r--r--jstests/core/list_namespaces_invalidation.js2
-rw-r--r--jstests/core/operation_latency_histogram.js7
-rw-r--r--jstests/core/rename8.js6
-rw-r--r--jstests/core/top.js7
-rw-r--r--jstests/core/txns/do_txn_atomicity.js2
-rw-r--r--jstests/core/views/views_creation.js5
-rw-r--r--jstests/core/views/views_drop.js2
-rw-r--r--jstests/multiVersion/index_bigkeys_secondary_downgrade_during_index_build_background.js11
-rw-r--r--jstests/noPassthrough/plan_cache_index_create.js5
-rw-r--r--jstests/noPassthroughWithMongod/create_indexes_shell_helper.js24
-rw-r--r--jstests/replsets/apply_ops_create_indexes.js31
-rw-r--r--jstests/replsets/oplog_format_create_indexes.js9
-rw-r--r--jstests/replsets/rollback_views.js5
-rw-r--r--jstests/sharding/clone_catalog_data.js4
-rw-r--r--jstests/sharding/move_primary_clone_test.js10
-rw-r--r--jstests/sharding/sharding_system_namespaces.js6
-rw-r--r--jstests/sharding/stats.js6
-rw-r--r--jstests/tool/dumprestoreWithNoOptions.js4
33 files changed, 80 insertions, 679 deletions
diff --git a/jstests/auth/basic_role_auth.js b/jstests/auth/basic_role_auth.js
index 81e1518152c..f21ef40d962 100644
--- a/jstests/auth/basic_role_auth.js
+++ b/jstests/auth/basic_role_auth.js
@@ -120,7 +120,12 @@ var testOps = function(db, allowedActions) {
});
checkErr(allowedActions.hasOwnProperty('index_r'), function() {
- db.system.indexes.findOne();
+ var errorCodeUnauthorized = 13;
+ var res = db.runCommand({"listIndexes": "user"});
+
+ if (res.code == errorCodeUnauthorized) {
+ throw Error("unauthorized listIndexes")
+ }
});
checkErr(allowedActions.hasOwnProperty('index_w'), function() {
diff --git a/jstests/auth/clac_system_colls.js b/jstests/auth/clac_system_colls.js
index 0b2fd75d69f..d9a6912e0ea 100644
--- a/jstests/auth/clac_system_colls.js
+++ b/jstests/auth/clac_system_colls.js
@@ -10,14 +10,7 @@ function runTest(admindb) {
admindb.createUser({user: "admin", pwd: "pwd", roles: ["userAdminAnyDatabase"]});
assert.eq(1, admindb.auth("admin", "pwd"));
- var sysCollections = [
- "system.indexes",
- "system.js",
- "system.namespaces",
- "system.profile",
- "system.roles",
- "system.users"
- ];
+ var sysCollections = ["system.js", "system.profile", "system.roles", "system.users"];
var sysPrivs = new Array();
for (var i in sysCollections) {
sysPrivs.push(
diff --git a/jstests/auth/indexSystemUsers.js b/jstests/auth/indexSystemUsers.js
index 10bcaf24965..8b9069b1afb 100644
--- a/jstests/auth/indexSystemUsers.js
+++ b/jstests/auth/indexSystemUsers.js
@@ -15,8 +15,6 @@ adminDB.auth('mallory', 'x');
var res = adminDB.system.users.createIndex({haxx: 1}, {unique: true, dropDups: true});
assert(!res.ok);
assert.eq(13, res.code); // unauthorized
-assert.writeError(adminDB.exploit.system.indexes.insert(
- {ns: "admin.system.users", key: {haxx: 1.0}, name: "haxx_1", unique: true, dropDups: true}));
// Make sure that no indexes were built.
var collectionInfosCursor = adminDB.runCommand("listCollections", {
filter: {
@@ -34,4 +32,4 @@ adminDB.logout();
adminDB.auth('admin', 'x');
// Make sure that no users were actually dropped
assert.eq(3, adminDB.system.users.count());
-MongoRunner.stopMongod(conn, null, {user: 'admin', pwd: 'x'}); \ No newline at end of file
+MongoRunner.stopMongod(conn, null, {user: 'admin', pwd: 'x'});
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js
index c50fc1c9d99..b61ab47137a 100644
--- a/jstests/auth/lib/commands_lib.js
+++ b/jstests/auth/lib/commands_lib.js
@@ -4604,34 +4604,24 @@ var authCommandsLib = {
db.x.drop();
db.y.drop();
},
- testcases: [
- {
- runOnDb: firstDbName,
- roles: {
- read: 1,
- readAnyDatabase: 1,
- readWrite: 1,
- readWriteAnyDatabase: 1,
- dbAdmin: 1,
- dbAdminAnyDatabase: 1,
- dbOwner: 1,
- backup: 1,
- restore: 1,
- root: 1,
- __system: 1
- },
- privileges:
- [{resource: {db: firstDbName, collection: ""}, actions: ["listCollections"]}]
+ testcases: [{
+ runOnDb: firstDbName,
+ roles: {
+ read: 1,
+ readAnyDatabase: 1,
+ readWrite: 1,
+ readWriteAnyDatabase: 1,
+ dbAdmin: 1,
+ dbAdminAnyDatabase: 1,
+ dbOwner: 1,
+ backup: 1,
+ restore: 1,
+ root: 1,
+ __system: 1
},
- // Test legacy (pre 3.0) way of authorizing listCollections.
- {
- runOnDb: firstDbName,
- privileges: [{
- resource: {db: firstDbName, collection: "system.namespaces"},
- actions: ["find"]
- }]
- }
- ]
+ privileges:
+ [{resource: {db: firstDbName, collection: ""}, actions: ["listCollections"]}]
+ }]
},
{
testname: "listOwnCollections",
@@ -4668,14 +4658,6 @@ var authCommandsLib = {
__system: 1
},
},
- // Test legacy (pre 3.0) way of authorizing listCollections.
- {
- runOnDb: firstDbName,
- privileges: [{
- resource: {db: firstDbName, collection: "system.namespaces"},
- actions: ["find"]
- }]
- },
{
runOnDb: firstDbName,
privileges: [{resource: {db: firstDbName, collection: "x"}, actions: ["find"]}]
@@ -4716,33 +4698,23 @@ var authCommandsLib = {
teardown: function(db) {
db.x.drop();
},
- testcases: [
- {
- runOnDb: firstDbName,
- roles: {
- read: 1,
- readAnyDatabase: 1,
- readWrite: 1,
- readWriteAnyDatabase: 1,
- dbAdmin: 1,
- dbAdminAnyDatabase: 1,
- dbOwner: 1,
- backup: 1,
- root: 1,
- __system: 1
- },
- privileges:
- [{resource: {db: firstDbName, collection: ""}, actions: ["listIndexes"]}]
+ testcases: [{
+ runOnDb: firstDbName,
+ roles: {
+ read: 1,
+ readAnyDatabase: 1,
+ readWrite: 1,
+ readWriteAnyDatabase: 1,
+ dbAdmin: 1,
+ dbAdminAnyDatabase: 1,
+ dbOwner: 1,
+ backup: 1,
+ root: 1,
+ __system: 1
},
- // Test legacy (pre 3.0) way of authorizing listIndexes.
- {
- runOnDb: firstDbName,
- privileges: [{
- resource: {db: firstDbName, collection: "system.indexes"},
- actions: ["find"]
- }]
- }
- ]
+ privileges:
+ [{resource: {db: firstDbName, collection: ""}, actions: ["listIndexes"]}]
+ }]
},
{
testname: "listIndexesWithUUID",
@@ -4759,25 +4731,14 @@ var authCommandsLib = {
teardown: function(db) {
db.x.drop();
},
- testcases: [
- {
- runOnDb: firstDbName,
- roles: {backup: 1, root: 1, __system: 1},
- privileges: [
- {resource: {db: firstDbName, collection: ""}, actions: ["listIndexes"]},
- {resource: {cluster: true}, actions: ["useUUID"]}
- ]
- },
- // Test legacy (pre 3.0) way of authorizing listIndexes.
- {
- runOnDb: firstDbName,
- privileges: [
- {resource: {db: firstDbName, collection: "system.indexes"}, actions: ["find"]},
- {resource: {cluster: true}, actions: ["useUUID"]}
-
- ]
- }
- ]
+ testcases: [{
+ runOnDb: firstDbName,
+ roles: {backup: 1, root: 1, __system: 1},
+ privileges: [
+ {resource: {db: firstDbName, collection: ""}, actions: ["listIndexes"]},
+ {resource: {cluster: true}, actions: ["useUUID"]}
+ ]
+ }]
},
{
diff --git a/jstests/core/apply_ops1.js b/jstests/core/apply_ops1.js
index e71c33ad9b6..0b098bed8a0 100644
--- a/jstests/core/apply_ops1.js
+++ b/jstests/core/apply_ops1.js
@@ -212,82 +212,6 @@
}),
"Excessively nested applyOps should be rejected");
- // Missing 'o' field value in an operation of type 'i' on 'system.indexes' collection.
- assert.commandFailedWithCode(
- db.adminCommand({applyOps: [{op: 'i', ns: db.getName() + '.system.indexes'}]}),
- ErrorCodes.NoSuchKey,
- 'applyOps should fail on system.indexes insert operation without "o" field');
-
- // Non-object 'o' field value in an operation of type 'i' on 'system.indexes' collection.
- assert.commandFailedWithCode(
- db.adminCommand({applyOps: [{op: 'i', ns: db.getName() + '.system.indexes', o: 'bar'}]}),
- ErrorCodes.TypeMismatch,
- 'applyOps should fail on system.indexes insert operation with non-object "o" field');
-
- // Missing 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.NoSuchKey,
- 'applyOps should fail on system.indexes insert operation with missing index namespace');
-
- // Non-string 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 12345,
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.TypeMismatch,
- 'applyOps should fail on system.indexes insert operation with non-string index namespace');
-
- // Invalid 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 'invalid_namespace',
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.InvalidNamespace,
- 'applyOps should fail on system.indexes insert operation with invalid index namespace');
-
- // Inconsistent database name in index spec namespace.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 'baddbprefix' + t.getFullName(),
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.InvalidNamespace,
- 'applyOps should fail on system.indexes insert operation with index namespace containing ' +
- 'inconsistent database name');
-
// Valid 'ns' field value in unknown operation type 'x'.
assert.commandFailed(
db.adminCommand({applyOps: [{op: 'x', ns: t.getFullName()}]}),
@@ -476,65 +400,6 @@
assert.eq(true, res.results[1], "Valid update with transaction number failed");
assert.eq(true, res.results[2], "Valid delete with transaction number failed");
- // Foreground index build.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {a: 1},
- name: "a_1",
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Foreground index creation failed");
- var allIndexes = t.getIndexes();
- var spec = GetIndexHelpers.findByName(allIndexes, "a_1");
- assert.neq(null, spec, "Foreground index 'a_1' not found: " + tojson(allIndexes));
- assert.eq(1, spec.v, "Expected v=1 index to be built since 'v' field was omitted");
-
- // Background indexes are created in the foreground when processed by applyOps.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {b: 1},
- name: "b_1",
- background: true,
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Background index creation failed");
- allIndexes = t.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "b_1");
- assert.neq(null, spec, "Background index 'b_1' not found: " + tojson(allIndexes));
- assert.eq(1, spec.v, "Expected v=1 index to be built since 'v' field was omitted");
-
- // Foreground v=2 index build.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {c: 1},
- name: "c_1",
- v: 2,
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Foreground v=2 index creation failed");
- allIndexes = t.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "c_1");
- assert.neq(null, spec, "Foreground index 'c_1' not found: " + tojson(allIndexes));
- assert.eq(2, spec.v, "Expected v=2 index to be built");
-
// When applying a "u" (update) op, we default to 'UpdateNode' update semantics, and $set
// operations add new fields in lexicographic order.
res = assert.commandWorked(db.adminCommand({
diff --git a/jstests/core/apply_ops_index_collation.js b/jstests/core/apply_ops_index_collation.js
index 135cb37483f..d58d3659223 100644
--- a/jstests/core/apply_ops_index_collation.js
+++ b/jstests/core/apply_ops_index_collation.js
@@ -87,66 +87,4 @@
assert.neq(null, spec, "Index 'b_1' not found: " + tojson(allIndexes));
assert.eq(1, spec.v, tojson(spec));
assert(!spec.hasOwnProperty("collation"), tojson(spec));
-
- // An index created using an insert-style oplog entry with a non-simple collation does not
- // inherit the collection default collation.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- op: "i",
- ns: db.system.indexes.getFullName(),
- o: {
- v: 2,
- key: {c: 1},
- name: "c_1_en",
- ns: coll.getFullName(),
- collation: {
- locale: "en_US",
- caseLevel: false,
- caseFirst: "off",
- strength: 3,
- numericOrdering: false,
- alternate: "non-ignorable",
- maxVariable: "punct",
- normalization: false,
- backwards: false,
- version: "57.1"
- }
- }
- }]
- }));
- allIndexes = coll.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "c_1_en");
- assert.neq(null, spec, "Index 'c_1_en' not found: " + tojson(allIndexes));
- assert.eq(2, spec.v, tojson(spec));
- assert.eq("en_US", spec.collation.locale, tojson(spec));
-
- // An index created using an insert-style oplog entry with a simple collation does not inherit
- // the collection default collation.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- op: "i",
- ns: db.system.indexes.getFullName(),
- o: {v: 2, key: {c: 1}, name: "c_1", ns: coll.getFullName()}
- }]
- }));
- allIndexes = coll.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "c_1");
- assert.neq(null, spec, "Index 'c_1' not found: " + tojson(allIndexes));
- assert.eq(2, spec.v, tojson(spec));
- assert(!spec.hasOwnProperty("collation"), tojson(spec));
-
- // A v=1 index created using an insert-style oplog entry does not inherit the collection default
- // collation.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- op: "i",
- ns: db.system.indexes.getFullName(),
- o: {v: 1, key: {d: 1}, name: "d_1", ns: coll.getFullName()}
- }]
- }));
- allIndexes = coll.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "d_1");
- assert.neq(null, spec, "Index 'd_1' not found: " + tojson(allIndexes));
- assert.eq(1, spec.v, tojson(spec));
- assert(!spec.hasOwnProperty("collation"), tojson(spec));
})();
diff --git a/jstests/core/batch_write_command_insert.js b/jstests/core/batch_write_command_insert.js
index d1e3fc8b600..5d0a85fa763 100644
--- a/jstests/core/batch_write_command_insert.js
+++ b/jstests/core/batch_write_command_insert.js
@@ -261,129 +261,6 @@ coll.find().forEach(function(doc) {
});
//
-//
-// Index insertion tests - currently supported via bulk write commands
-
-//
-// Successful index creation
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), key: {x: 1}, name: "x_1"}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(1, result.n);
-var allIndexes = coll.getIndexes();
-var spec = GetIndexHelpers.findByName(allIndexes, "x_1");
-assert.neq(null, spec, "Index with name 'x_1' not found: " + tojson(allIndexes));
-assert.lte(2, spec.v, tojson(spec));
-
-// Test that a v=1 index can be created by inserting into the system.indexes collection.
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), key: {x: 1}, name: "x_1", v: 1}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(1, result.n);
-allIndexes = coll.getIndexes();
-spec = GetIndexHelpers.findByName(allIndexes, "x_1");
-assert.neq(null, spec, "Index with name 'x_1' not found: " + tojson(allIndexes));
-assert.eq(1, spec.v, tojson(spec));
-
-//
-// Duplicate index insertion gives n = 0
-coll.drop();
-coll.ensureIndex({x: 1}, {unique: true});
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), key: {x: 1}, name: "x_1", unique: true}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(0, result.n, 'duplicate index insertion should give n = 0: ' + tojson(result));
-assert(!('writeErrors' in result));
-assert.eq(coll.getIndexes().length, 2);
-
-//
-// Invalid index insertion with mismatched collection db
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: "invalid." + coll.getName(), key: {x: 1}, name: "x_1", unique: true}]
-};
-result = coll.runCommand(request);
-assert(!result.ok || (result.n == 0 && result.writeErrors.length == 1), tojson(result));
-assert.eq(coll.getIndexes().length, 0);
-
-//
-// Empty index insertion
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{}]
-};
-result = coll.runCommand(request);
-assert(!result.ok || (result.n == 0 && result.writeErrors.length == 1), tojson(result));
-assert.eq(coll.getIndexes().length, 0);
-
-//
-// Invalid index desc
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString()}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(0, result.n);
-assert.eq(0, result.writeErrors[0].index);
-assert.eq(coll.getIndexes().length, 0);
-
-//
-// Invalid index desc
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), key: {x: 1}}]
-};
-result = coll.runCommand(request);
-print(tojson(result));
-assert(result.ok, tojson(result));
-assert.eq(0, result.n);
-assert.eq(0, result.writeErrors[0].index);
-assert.eq(coll.getIndexes().length, 0);
-
-//
-// Invalid index desc
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), name: "x_1"}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(0, result.n);
-assert.eq(0, result.writeErrors[0].index);
-assert.eq(coll.getIndexes().length, 0);
-
-//
-// Cannot insert more than one index at a time through the batch writes
-coll.drop();
-request = {
- insert: "system.indexes",
- documents: [
- {ns: coll.toString(), key: {x: 1}, name: "x_1"},
- {ns: coll.toString(), key: {y: 1}, name: "y_1"}
- ]
-};
-result = coll.runCommand(request);
-assert(!result.ok, tojson(result));
-assert.eq(coll.getIndexes().length, 0);
-
-//
// Ensure we error out correctly in the middle of a batch
coll.drop();
coll.insert({_id: 50}); // Create a document to force a duplicate key exception.
@@ -398,21 +275,3 @@ try {
} catch (err) {
assert(coll.count() == 50, "Unexpected number inserted by bulk write: " + coll.count());
}
-
-//
-// Background index creation
-// Note: due to SERVER-13304 this test is at the end of this file, and we don't drop
-// the collection afterwards.
-coll.drop();
-coll.insert({x: 1});
-request = {
- insert: "system.indexes",
- documents: [{ns: coll.toString(), key: {x: 1}, name: "x_1", background: true}]
-};
-result = coll.runCommand(request);
-assert(result.ok, tojson(result));
-assert.eq(1, result.n);
-allIndexes = coll.getIndexes();
-spec = GetIndexHelpers.findByName(allIndexes, "x_1");
-assert.neq(null, spec, "Index with name 'x_1' not found: " + tojson(allIndexes));
-assert.lte(2, spec.v, tojson(spec));
diff --git a/jstests/core/cannot_create_system_dot_indexes.js b/jstests/core/cannot_create_system_dot_indexes.js
deleted file mode 100644
index 50928d5a27d..00000000000
--- a/jstests/core/cannot_create_system_dot_indexes.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Tests that a user cannot create the 'system.indexes' collection.
-// @tags: [requires_non_retryable_commands]
-(function() {
- "use strict";
-
- // Cannot create system.indexes using the 'create' command.
- assert.commandFailedWithCode(db.createCollection("system.indexes"),
- ErrorCodes.InvalidNamespace);
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-
- // Cannot create system.indexes using the 'renameCollection' command.
- db.coll.drop();
- assert.commandWorked(db.coll.insert({}));
- assert.commandFailed(db.coll.renameCollection("system.indexes"));
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-
- // Cannot create system.indexes using the 'createIndexes' command.
- assert.commandFailedWithCode(db.system.indexes.createIndex({a: 1}),
- ErrorCodes.InvalidNamespace);
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-
- // Cannot create system.indexes using the 'insert' command.
- assert.commandWorked(
- db.system.indexes.insert({ns: "test.coll", v: 2, key: {a: 1}, name: "a_1"}));
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-
- // Cannot create system.indexes using the 'update' command with upsert=true.
- assert.commandFailedWithCode(
- db.system.indexes.update({ns: "test.coll", v: 2, key: {a: 1}, name: "a_1"},
- {$set: {name: "a_1"}},
- {upsert: true}),
- ErrorCodes.InvalidNamespace);
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-
- // Cannot create system.indexes using the 'findAndModify' command with upsert=true.
- let error = assert.throws(() => {
- db.system.indexes.findAndModify({
- query: {ns: "test.coll", v: 2, key: {a: 1}, name: "a_1"},
- update: {$set: {name: "a_1"}},
- upsert: true
- });
- });
- assert.eq(error.code, ErrorCodes.InvalidNamespace);
- assert.eq(
- 0, db.getCollectionInfos({name: "system.indexes"}).length, tojson(db.getCollectionInfos()));
-}());
diff --git a/jstests/core/indexOtherNamespace.js b/jstests/core/indexOtherNamespace.js
deleted file mode 100644
index 86589714a35..00000000000
--- a/jstests/core/indexOtherNamespace.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// SERVER-8814: Test that only the system.indexes namespace can be used to build indexes.
-
-// Include helpers for analyzing explain output.
-load("jstests/libs/analyze_plan.js");
-
-var otherDB = db.getSiblingDB("indexOtherNS");
-otherDB.dropDatabase();
-
-otherDB.foo.insert({a: 1});
-assert.eq(1, otherDB.foo.getIndexes().length);
-assert(isCollscan(db, otherDB.foo.find({a: 1}).explain().queryPlanner.winningPlan));
-
-assert.writeError(
- otherDB.randomNS.system.indexes.insert({ns: "indexOtherNS.foo", key: {a: 1}, name: "a_1"}));
-
-// Assert that index didn't actually get built
-assert.eq(1, otherDB.foo.getIndexes().length);
-assert(isCollscan(db, otherDB.foo.find({a: 1}).explain().queryPlanner.winningPlan));
-otherDB.dropDatabase();
diff --git a/jstests/core/indexapi.js b/jstests/core/indexapi.js
index 3153519501a..14cf634e556 100644
--- a/jstests/core/indexapi.js
+++ b/jstests/core/indexapi.js
@@ -43,7 +43,3 @@ idx = t.getIndexes();
assert.eq(2, idx.length, "M1");
assert.eq(key, idx[1].key, "M2");
assert(idx[1].unique, "M3");
-// printjson( idx );
-
-// Test that attempting to create index in an invalid namespace fails.
-assert.writeError(db.system.indexes.insert({ns: "test", key: {x: 1}, name: "x"}));
diff --git a/jstests/core/indexes_on_indexes.js b/jstests/core/indexes_on_indexes.js
deleted file mode 100644
index b7c4b7edcb5..00000000000
--- a/jstests/core/indexes_on_indexes.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Ensure an index cannot be created on system.indexes
-(function() {
- var t = db.getSiblingDB("indexes_on_indexes");
- t.dropDatabase();
- t.coll.insert({});
-
- printjson(t.system.indexes.getIndexes());
- assert.eq(t.system.indexes.getIndexes().length, 0);
-
- print("trying via ensureIndex");
- assert.commandFailed(t.system.indexes.ensureIndex({_id: 1}));
- printjson(t.system.indexes.getIndexes());
- assert.eq(t.system.indexes.getIndexes().length, 0);
-
- print("trying via createIndex");
- assert.commandFailed(t.system.indexes.createIndex({_id: 1}));
- printjson(t.system.indexes.getIndexes());
- assert.eq(t.system.indexes.getIndexes().length, 0);
-
- print("trying via direct insertion");
- assert.commandFailed(t.system.indexes.insert(
- {v: 1, key: {_id: 1}, ns: "indexes_on_indexes.system.indexes", name: "wontwork"}));
- printjson(t.system.indexes.getIndexes());
- assert.eq(t.system.indexes.getIndexes().length, 0);
-}());
diff --git a/jstests/core/list_collections1.js b/jstests/core/list_collections1.js
index f23331b97ce..33377c2db97 100644
--- a/jstests/core/list_collections1.js
+++ b/jstests/core/list_collections1.js
@@ -58,20 +58,6 @@
assert(!collObj.hasOwnProperty("idIndex"), tojson(collObj));
//
- // Test basic command output for system.indexes.
- //
-
- collObj = res.cursor.firstBatch.filter(function(c) {
- return c.name === "system.indexes";
- })[0];
- if (collObj) {
- assert.eq("object", typeof(collObj.options), tojson(collObj));
- assert.eq("collection", collObj.type, tojson(collObj));
- assert.eq(false, collObj.info.readOnly, tojson(collObj));
- assert(!collObj.hasOwnProperty("idIndex"), tojson(collObj));
- }
-
- //
// Test basic usage with DBCommandCursor.
//
diff --git a/jstests/core/list_collections_filter.js b/jstests/core/list_collections_filter.js
index 76feeb9dd4b..ef162642bdf 100644
--- a/jstests/core/list_collections_filter.js
+++ b/jstests/core/list_collections_filter.js
@@ -24,16 +24,12 @@
function stripToName(result) {
return result.name;
}
- function isNotSystemIndexes(result) {
- return result !== "system.indexes";
- }
- var cursorResultNames = cursor.toArray().map(stripToName).filter(isNotSystemIndexes);
+ var cursorResultNames = cursor.toArray().map(stripToName);
assert.eq(cursorResultNames.sort(), expectedNames.sort());
// Assert the shell helper returns the same list, but in sorted order.
- var shellResultNames =
- mydb.getCollectionInfos(filter).map(stripToName).filter(isNotSystemIndexes);
+ var shellResultNames = mydb.getCollectionInfos(filter).map(stripToName);
assert.eq(shellResultNames, expectedNames.sort());
}
diff --git a/jstests/core/list_collections_no_views.js b/jstests/core/list_collections_no_views.js
index 7ff19c9adce..b380f8c3db6 100644
--- a/jstests/core/list_collections_no_views.js
+++ b/jstests/core/list_collections_no_views.js
@@ -26,9 +26,6 @@
assert.eq(allExpected,
all.cursor.firstBatch
- .filter(function(c) {
- return c.name != "system.indexes";
- })
.map(function(c) {
return {name: c.name, type: c.type};
})
@@ -66,9 +63,6 @@
assert.eq(collOnlyExpected,
collOnly.cursor.firstBatch
- .filter(function(c) {
- return c.name != "system.indexes";
- })
.map(function(c) {
return {name: c.name, type: c.type};
})
@@ -93,9 +87,6 @@
assert.eq(viewOnlyExpected,
viewOnly.cursor.firstBatch
- .filter(function(c) {
- return c.name != "system.indexes";
- })
.map(function(c) {
return {name: c.name, type: c.type};
})
@@ -117,9 +108,6 @@
let collOnlyInvalidView = mydb.runCommand(collOnlyCommand);
assert.eq(collOnlyExpected,
collOnlyInvalidView.cursor.firstBatch
- .filter(function(c) {
- return c.name != "system.indexes";
- })
.map(function(c) {
return {name: c.name, type: c.type};
})
diff --git a/jstests/core/list_indexes_invalidation.js b/jstests/core/list_indexes_invalidation.js
index 75a62da531a..38a70ce4005 100644
--- a/jstests/core/list_indexes_invalidation.js
+++ b/jstests/core/list_indexes_invalidation.js
@@ -2,7 +2,6 @@
// on sharded collections.
// @tags: [assumes_unsharded_collection, requires_non_retryable_commands, requires_fastcount]
-// SERVER-24963/SERVER-27930 Missing invalidation for system.indexes writes
(function() {
'use strict';
let collName = 'system_indexes_invalidations';
diff --git a/jstests/core/list_namespaces_invalidation.js b/jstests/core/list_namespaces_invalidation.js
index da5d392b9f5..ebd5dd82542 100644
--- a/jstests/core/list_namespaces_invalidation.js
+++ b/jstests/core/list_namespaces_invalidation.js
@@ -1,6 +1,4 @@
// @tags: [requires_non_retryable_commands, requires_fastcount]
-
-// SERVER-27996/SERVER-28022 Missing invalidation for system.namespaces writes
(function() {
'use strict';
let dbInvalidName = 'system_namespaces_invalidations';
diff --git a/jstests/core/operation_latency_histogram.js b/jstests/core/operation_latency_histogram.js
index 1e971dc93eb..a8f0800b327 100644
--- a/jstests/core/operation_latency_histogram.js
+++ b/jstests/core/operation_latency_histogram.js
@@ -121,12 +121,7 @@
// CreateIndex
assert.commandWorked(testColl.createIndex({pt: "2dsphere"}));
- // The createIndex shell helper is run as an insert when writeMode is not "commands".
- if (testDB.getMongo().writeMode() === "commands") {
- lastHistogram = assertHistogramDiffEq(testColl, lastHistogram, 0, 0, 1);
- } else {
- lastHistogram = assertHistogramDiffEq(testColl, lastHistogram, 0, 1, 0);
- }
+ lastHistogram = assertHistogramDiffEq(testColl, lastHistogram, 0, 0, 1);
// $geoNear aggregation stage
assert.commandWorked(testDB.runCommand({
diff --git a/jstests/core/rename8.js b/jstests/core/rename8.js
index d0a2a2fea60..923b0a52cec 100644
--- a/jstests/core/rename8.js
+++ b/jstests/core/rename8.js
@@ -5,7 +5,6 @@
var testdb =
db.getSiblingDB("rename8"); // to avoid breaking other tests when we touch system.users
var coll = testdb.rename8;
-var systemNamespaces = testdb.system.namespaces;
var systemFoo = testdb.system.foo;
var systemUsers = testdb.system.users;
@@ -18,11 +17,6 @@ coll.insert({});
assert.commandFailed(coll.renameCollection(systemFoo.getName()));
assert.commandFailed(systemFoo.renameCollection(coll.getName()));
-// same with system.namespaces, even though it does exist
-assert.commandFailed(coll.renameCollection(systemNamespaces.getName()));
-assert.commandFailed(coll.renameCollection(systemNamespaces.getName(), /*dropTarget*/ true));
-assert.commandFailed(systemNamespaces.renameCollection(coll.getName()));
-
// system.users is whitelisted so these should work
assert.commandWorked(coll.renameCollection(systemUsers.getName()));
assert.commandWorked(systemUsers.renameCollection(coll.getName()));
diff --git a/jstests/core/top.js b/jstests/core/top.js
index 5919cdbe59d..eca4570472f 100644
--- a/jstests/core/top.js
+++ b/jstests/core/top.js
@@ -114,12 +114,7 @@
// createIndex
res = assert.commandWorked(testColl.createIndex({x: 1}));
assertTopDiffEq(testColl, lastTop, "writeLock", 1);
- // The createIndex shell helper is run as an insert when writeMode is not "commands".
- if (testDB.getMongo().writeMode() === "commands") {
- lastTop = assertTopDiffEq(testColl, lastTop, "commands", 1);
- } else {
- lastTop = assertTopDiffEq(testColl, lastTop, "insert", 1);
- }
+ lastTop = assertTopDiffEq(testColl, lastTop, "commands", 1);
// dropIndex
res = assert.commandWorked(testColl.dropIndex({x: 1}));
diff --git a/jstests/core/txns/do_txn_atomicity.js b/jstests/core/txns/do_txn_atomicity.js
index f7077bd863e..59307a4641b 100644
--- a/jstests/core/txns/do_txn_atomicity.js
+++ b/jstests/core/txns/do_txn_atomicity.js
@@ -31,7 +31,7 @@
],
txnNumber: NumberLong(txnNumber++)
}),
- 16886); // nsToCollectionSubstring: no .
+ ErrorCodes.InvalidNamespace);
assert.eq(t.count({x: 1}), 0);
// Operations on non-existent databases cannot be atomic.
diff --git a/jstests/core/views/views_creation.js b/jstests/core/views/views_creation.js
index 7fd2686dff5..68c896118a5 100644
--- a/jstests/core/views/views_creation.js
+++ b/jstests/core/views/views_creation.js
@@ -20,11 +20,6 @@
ErrorCodes.InvalidNamespace,
"Created an illegal view named 'system.views'");
- assert.commandFailedWithCode(
- viewsDB.runCommand({create: "system.indexes", viewOn: "collection"}),
- ErrorCodes.InvalidNamespace,
- "Created an illegal view named 'system.indexes'");
-
// Collections that start with 'system.' that are not special to MongoDB fail with a different
// error code.
assert.commandFailedWithCode(viewsDB.runCommand({create: "system.foo", viewOn: "collection"}),
diff --git a/jstests/core/views/views_drop.js b/jstests/core/views/views_drop.js
index bc2a654415e..bf3498d85a6 100644
--- a/jstests/core/views/views_drop.js
+++ b/jstests/core/views/views_drop.js
@@ -27,7 +27,7 @@
// Database should now be empty.
let res = viewsDB.runCommand({listCollections: 1});
assert.commandWorked(res);
- assert.eq(res.cursor.firstBatch.filter((entry) => entry.name != "system.indexes"),
+ assert.eq(res.cursor.firstBatch,
[],
viewsDBName + " is not empty after deleting views and system.views");
})();
diff --git a/jstests/multiVersion/index_bigkeys_secondary_downgrade_during_index_build_background.js b/jstests/multiVersion/index_bigkeys_secondary_downgrade_during_index_build_background.js
index 80f1a911b61..20836332643 100644
--- a/jstests/multiVersion/index_bigkeys_secondary_downgrade_during_index_build_background.js
+++ b/jstests/multiVersion/index_bigkeys_secondary_downgrade_during_index_build_background.js
@@ -45,7 +45,16 @@
// Make sure index build starts on the secondary.
assert.soon(() => {
- let res = secondaryDB.currentOp({"ns": "test.system.indexes"});
+ // The currentOp entry for createIndexes looks like:
+ // {...,
+ // "command": {"v": 2,
+ // "key": {x: 1},
+ // "name": "x_1",
+ // "background": true,
+ // "ns": "test.index_bigkeys_downgrade_during_index_build"},
+ // ...
+ // }
+ let res = secondaryDB.currentOp({'command.name': "x_1"});
return res['ok'] === 1 && res["inprog"].length > 0;
});
diff --git a/jstests/noPassthrough/plan_cache_index_create.js b/jstests/noPassthrough/plan_cache_index_create.js
index 57f63a7a326..9213f59bc38 100644
--- a/jstests/noPassthrough/plan_cache_index_create.js
+++ b/jstests/noPassthrough/plan_cache_index_create.js
@@ -16,10 +16,7 @@
"command.indexes.0.name": indexName
};
// TODO SERVER-34830: Add command name filter for secondaries once available.
- const secondaryIndexBuildFilter = {
- ns: dbName + ".system.indexes",
- "command.name": indexName
- };
+ const secondaryIndexBuildFilter = {"command.name": indexName};
const curOp = testDB.getSiblingDB("admin").aggregate([
{$currentOp: {}},
{$match: {$or: [primaryIndexBuildFilter, secondaryIndexBuildFilter]}}
diff --git a/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js b/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js
index 6d9937139ae..8a36f7ee11e 100644
--- a/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js
+++ b/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js
@@ -9,11 +9,8 @@
var commandsRan = [];
var insertsRan = [];
var mockMongo = {
- forceWriteMode: function(mode) {
- this._writeMode = mode;
- },
writeMode: function() {
- return this._writeMode;
+ return "commands";
},
getSlaveOk: function() {
return true;
@@ -22,10 +19,6 @@
commandsRan.push({db: db, cmd: cmd, opts: opts});
return {ok: 1.0};
},
- insert: function(db, indexSpecs, opts) {
- insertsRan.push({db: db, indexSpecs: indexSpecs, opts: opts});
- return {ok: 1.0};
- },
getWriteConcern: function() {
return null;
},
@@ -58,8 +51,6 @@
db._mongo = mockMongo;
db._session = new _DummyDriverSession(mockMongo);
- mockMongo.forceWriteMode("commands");
-
t.createIndexes([{x: 1}]);
assert.eq(commandsRan.length, 1);
assert(commandsRan[0].cmd.hasOwnProperty("createIndexes"));
@@ -79,19 +70,6 @@
assert.eq(commandsRan.length, 1);
assert(commandsRan[0].cmd.hasOwnProperty("createIndexes"));
assert.eq(commandsRan[0].cmd["indexes"][0], {key: {a: 1}, name: "a_1"});
-
- db.getMongo().forceWriteMode("compatibility");
-
- commandsRan = [];
- assert.eq(commandsRan.length, 0);
- t.createIndex({b: 1});
- assert.eq(insertsRan.length, 1);
- assert.eq(insertsRan[0]["indexSpecs"]["ns"], "test.create_indexes_shell_helper");
- assert.eq(insertsRan[0]["indexSpecs"]["key"], {b: 1});
- assert.eq(insertsRan[0]["indexSpecs"]["name"], "b_1");
- // getLastError is called in the course of the bulk insert
- assert.eq(commandsRan.length, 1);
- assert(commandsRan[0].cmd.hasOwnProperty("getlasterror"));
} finally {
db._mongo = mongo;
db._session = new _DummyDriverSession(mongo);
diff --git a/jstests/replsets/apply_ops_create_indexes.js b/jstests/replsets/apply_ops_create_indexes.js
index 4fe813b5ed4..f400265afb0 100644
--- a/jstests/replsets/apply_ops_create_indexes.js
+++ b/jstests/replsets/apply_ops_create_indexes.js
@@ -1,6 +1,5 @@
/* This test ensures that indexes created by running applyOps are successfully replicated (see
- * SERVER-31435). Both insertion into system.indexes and createIndexes style oplog entries are
- * passed to applyOps here.
+ * SERVER-31435).
*/
(function() {
"use strict";
@@ -70,33 +69,5 @@
ensureIndexExists(secondaryTestDB, collName, cmdFormatIndexName, 2);
}
- // Create an index by inserting into system.indexes in applyOps.
- let insertFormatIndexName = "b_1";
- cmd = {
- applyOps: [{
- "op": "i",
- "ns": dbName + ".system.indexes",
- "o": {
- ns: dbName + "." + collName,
- key: {b: 1},
- name: insertFormatIndexName,
- }
- }]
- };
- res = primaryTestDB.adminCommand(cmd);
- assert.commandWorked(res, "could not run " + tojson(cmd));
- rst.awaitReplication();
- ensureIndexExists(primaryTestDB, collName, insertFormatIndexName, 3);
-
- // Make sure the index was replicated to the secondaries.
- secondaries = rst.getSecondaries();
- for (let j = 0; j < secondaries.length; j++) {
- let secondaryTestDB = secondaries[j].getDB(dbName);
- ensureIndexExists(secondaryTestDB, collName, insertFormatIndexName, 3);
- }
-
- localDB = rst.getPrimary().getDB("local");
- ensureOplogEntryExists(localDB, insertFormatIndexName);
-
rst.stopSet();
}());
diff --git a/jstests/replsets/oplog_format_create_indexes.js b/jstests/replsets/oplog_format_create_indexes.js
index ec779e28457..0697df44b07 100644
--- a/jstests/replsets/oplog_format_create_indexes.js
+++ b/jstests/replsets/oplog_format_create_indexes.js
@@ -26,13 +26,10 @@
indexSpec,
"Index with key pattern " + tojson(keyPattern) + " not found: " + tojson(allIndexes));
- // Find either the old-style insert into system.indexes index creations, or new-style
- // createIndexes command entries.
+ // Find the createIndexes command entries.
const indexCreationOplogQuery = {
- $or: [
- {op: "i", ns: testDB.system.indexes.getFullName()},
- {op: "c", ns: testDB.getName() + ".$cmd", "o.createIndexes": coll.getName()}
- ]
+ op: "c",
+ ns: testDB.getName() + ".$cmd", "o.createIndexes": coll.getName()
};
const allOplogEntries = oplogColl.find(indexCreationOplogQuery).toArray();
diff --git a/jstests/replsets/rollback_views.js b/jstests/replsets/rollback_views.js
index a833ed82ecc..a7c89014de6 100644
--- a/jstests/replsets/rollback_views.js
+++ b/jstests/replsets/rollback_views.js
@@ -23,11 +23,10 @@ load("jstests/replsets/rslib.js");
let checkedRunCommand = (db, cmd) =>
((res, msg) => (assert.commandWorked(res, msg), res))(db.runCommand(cmd), tojson(cmd));
- // Like db.getCollectionNames, but allows a filter and works without system.namespaces.
+ // Like db.getCollectionNames, but allows a filter.
let getCollectionNames = (db, filter) => checkedRunCommand(db, {listCollections: 1, filter})
.cursor.firstBatch.map((entry) => entry.name)
- .sort()
- .filter((name) => name != "system.indexes");
+ .sort();
// Function that checks that all array elements are equal, and returns the unique element.
let checkEqual = (array, what) =>
diff --git a/jstests/sharding/clone_catalog_data.js b/jstests/sharding/clone_catalog_data.js
index f0cf4fac12d..dfb5863f69f 100644
--- a/jstests/sharding/clone_catalog_data.js
+++ b/jstests/sharding/clone_catalog_data.js
@@ -54,7 +54,7 @@
var res = fromShard.getDB('test').runCommand({listCollections: 1});
assert.commandWorked(res);
- var collections = res.cursor.firstBatch.filter(coll => coll.name != 'system.indexes');
+ var collections = res.cursor.firstBatch;
collections.sort(sortByName);
var coll2uuid = collections[1].info.uuid;
@@ -67,7 +67,7 @@
res = toShard.getDB('test').runCommand({listCollections: 1});
assert.commandWorked(res);
- collections = res.cursor.firstBatch.filter(coll => coll.name != 'system.indexes');
+ collections = res.cursor.firstBatch;
// There should be 2 collections: coll1, coll2
assert.eq(collections.length, 2);
diff --git a/jstests/sharding/move_primary_clone_test.js b/jstests/sharding/move_primary_clone_test.js
index 2ef19b044bf..6c30ff56b46 100644
--- a/jstests/sharding/move_primary_clone_test.js
+++ b/jstests/sharding/move_primary_clone_test.js
@@ -13,9 +13,7 @@
var res = toShard.getDB("test1").runCommand({listCollections: 1});
assert.commandWorked(res);
- // Remove system.indexes collection (which exists in mmap)
- // Indexes are checked separately below.
- var collections = res.cursor.firstBatch.filter(coll => coll.name != 'system.indexes');
+ var collections = res.cursor.firstBatch;
// Sort collections by name.
collections.sort(sortByName);
@@ -145,8 +143,7 @@
assert.eq(0, toShard.getDB("test1").bar.count(), "to shard has data before move");
var listCollsFrom = fromShard.getDB("test1").runCommand({listCollections: 1});
- var fromColls =
- listCollsFrom.cursor.firstBatch.filter(coll => coll.name != 'system.indexes');
+ var fromColls = listCollsFrom.cursor.firstBatch;
fromColls.sort(sortByName);
var baruuid = fromColls[0].info.uuid;
var foouuid = fromColls[1].info.uuid;
@@ -194,8 +191,7 @@
assert.eq(0, toShard.getDB("test1").bar.count(), "to shard has data before move");
var listCollsFrom = fromShard.getDB("test1").runCommand({listCollections: 1});
- var fromColls =
- listCollsFrom.cursor.firstBatch.filter(coll => coll.name != 'system.indexes');
+ var fromColls = listCollsFrom.cursor.firstBatch;
fromColls.sort(sortByName);
var baruuid = fromColls[0].info.uuid;
var foouuid = fromColls[1].info.uuid;
diff --git a/jstests/sharding/sharding_system_namespaces.js b/jstests/sharding/sharding_system_namespaces.js
index b46487dacd8..d44f1150d64 100644
--- a/jstests/sharding/sharding_system_namespaces.js
+++ b/jstests/sharding/sharding_system_namespaces.js
@@ -1,12 +1,6 @@
-// SERVER-16498 d_migrate.cpp should not rely on system.namespaces
-//
// 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
-// system.namespaces on the donor, which is empty on wiredtiger.
-// As a result, the new collection created on receiver has different
-// options.
var st = new ShardingTest({shards: 2});
diff --git a/jstests/sharding/stats.js b/jstests/sharding/stats.js
index 26bd656ac4d..76c64c8b41f 100644
--- a/jstests/sharding/stats.js
+++ b/jstests/sharding/stats.js
@@ -84,10 +84,8 @@
'indexDetails should not be present in s.shard1.shardName: ' +
tojson(x.shards[s.shard1.shardName]));
- a_extras =
- a.stats().objects - a.foo.count(); // things like system.namespaces and system.indexes
- b_extras =
- b.stats().objects - b.foo.count(); // things like system.namespaces and system.indexes
+ a_extras = a.stats().objects - a.foo.count();
+ b_extras = b.stats().objects - b.foo.count();
print("a_extras: " + a_extras);
print("b_extras: " + b_extras);
diff --git a/jstests/tool/dumprestoreWithNoOptions.js b/jstests/tool/dumprestoreWithNoOptions.js
index a1782d3ff7c..e6fdbd87ca8 100644
--- a/jstests/tool/dumprestoreWithNoOptions.js
+++ b/jstests/tool/dumprestoreWithNoOptions.js
@@ -13,10 +13,6 @@ t = new ToolTest("dumprestoreWithNoOptions");
t.startDB("foo");
db = t.db;
-// We turn this off to prevent the server from touching the 'options' field in system.namespaces.
-// This is important because we check exact values of the 'options' field in this test.
-db.adminCommand({setParameter: 1, newCollectionsUsePowerOf2Sizes: false});
-
dbname = db.getName();
dbname2 = "NOT_" + dbname;