summaryrefslogtreecommitdiff
path: root/jstests/sharding/server_status_crud_metrics.js
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2019-09-24 15:38:39 +0000
committerevergreen <evergreen@mongodb.com>2019-09-24 15:38:39 +0000
commit2f5feed026e1c22bce29cf2efe746d55879d4a14 (patch)
tree2915b778f207efc398462ca840c7b4557c042569 /jstests/sharding/server_status_crud_metrics.js
parentccbc2473f57504f9ce08096efd000fb37a9e90fc (diff)
downloadmongo-2f5feed026e1c22bce29cf2efe746d55879d4a14.tar.gz
SERVER-42390 Allow documents in a sharded collection to not contain all shard key fields
Diffstat (limited to 'jstests/sharding/server_status_crud_metrics.js')
-rw-r--r--jstests/sharding/server_status_crud_metrics.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/jstests/sharding/server_status_crud_metrics.js b/jstests/sharding/server_status_crud_metrics.js
index 6ffefe87b71..20b0274ae9d 100644
--- a/jstests/sharding/server_status_crud_metrics.js
+++ b/jstests/sharding/server_status_crud_metrics.js
@@ -31,16 +31,14 @@ assert.commandWorked(testDB.coll.update({_id: 1}, {$set: {a: 2}}, {multi: false}
// Should increment the metric because we broadcast by _id, even though the update subsequently
// fails on the individual shard.
-assert.commandFailedWithCode(testDB.coll.update({_id: 1}, {$set: {x: 2}}, {multi: false}),
- [ErrorCodes.ImmutableField, 31025]);
assert.commandFailedWithCode(
testDB.coll.update({_id: 1}, {$set: {x: 2, $invalidField: 4}}, {multi: false}),
ErrorCodes.DollarPrefixedFieldName);
let mongosServerStatus = testDB.adminCommand({serverStatus: 1});
-// Verify that the above four updates incremented the metric counter.
-assert.eq(4, mongosServerStatus.metrics.query.updateOneOpStyleBroadcastWithExactIDCount);
+// Verify that the above three updates incremented the metric counter.
+assert.eq(3, mongosServerStatus.metrics.query.updateOneOpStyleBroadcastWithExactIDCount);
// Shouldn't increment the metric when {multi:true}.
assert.commandWorked(testDB.coll.update({_id: 1}, {$set: {a: 3}}, {multi: true}));
@@ -71,8 +69,8 @@ assert.commandFailedWithCode(
mongosServerStatus = testDB.adminCommand({serverStatus: 1});
-// Verify that only the first four upserts incremented the metric counter.
-assert.eq(4, mongosServerStatus.metrics.query.updateOneOpStyleBroadcastWithExactIDCount);
+// Verify that only the first three upserts incremented the metric counter.
+assert.eq(3, mongosServerStatus.metrics.query.updateOneOpStyleBroadcastWithExactIDCount);
st.stop();
})();