summaryrefslogtreecommitdiff
path: root/jstests/sharding
diff options
context:
space:
mode:
authorHaley Connelly <haley.connelly@mongodb.com>2021-06-17 20:11:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-09 18:07:25 +0000
commit28bd2d76e81aca35b300efb48010460e7d441162 (patch)
tree892795e5173292672526de5a6885e67afac048e0 /jstests/sharding
parent95b18771c85283900f7a992b7eda350b8a3d6067 (diff)
downloadmongo-28bd2d76e81aca35b300efb48010460e7d441162.tar.gz
SERVER-57760 Introduce resharding dedicated OpCounters and use them in
ReshardingOplogApplier
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/resharding_metrics_increment.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/jstests/sharding/resharding_metrics_increment.js b/jstests/sharding/resharding_metrics_increment.js
index 914ac1503bb..2291f647c00 100644
--- a/jstests/sharding/resharding_metrics_increment.js
+++ b/jstests/sharding/resharding_metrics_increment.js
@@ -94,8 +94,20 @@ const topology = DiscoverTopology.findConnectedNodes(mongos);
// baseline of 2 fetches/applies on each recipient (one "no-op" for each donor).
// Additionally, recipientShard[1] gets the 10 late inserts above, so expect 12
// oplogEntry applies for those late inserts.
-[{shardName: recipientShardNames[0], documents: 2, fetched: 2, applied: 2},
- {shardName: recipientShardNames[1], documents: 2, fetched: 12, applied: 12},
+[{
+ shardName: recipientShardNames[0],
+ documents: 2,
+ fetched: 2,
+ applied: 2,
+ opcounters: {insert: 0, update: 0, delete: 0}
+},
+ {
+ shardName: recipientShardNames[1],
+ documents: 2,
+ fetched: 12,
+ applied: 12,
+ opcounters: {insert: 10, update: 0, delete: 0}
+ },
].forEach(e => {
const mongo = new Mongo(topology.shards[e.shardName].primary);
const doc = mongo.getDB('admin').serverStatus({});
@@ -113,6 +125,13 @@ const topology = DiscoverTopology.findConnectedNodes(mongos);
"oplogEntriesFetched": e.fetched,
"oplogEntriesApplied": e.applied,
});
+
+ verifyDict(sub.opcounters, {
+ "insert": e.opcounters.insert,
+ "update": e.opcounters.update,
+ "delete": e.opcounters.delete,
+ });
+
// bytesCopied is harder to pin down but it should be >0.
assert.betweenIn(1, sub['bytesCopied'], 1024, 'bytesCopied');
});