Skip to content

Commit 491a4a8

Browse files
malikendsleygregorynoma
authored andcommitted
SERVER-100924: make bulkWrite with rawData explainable (#33952)
Co-authored-by: Gregory Noma <[email protected]> GitOrigin-RevId: 79ee243
1 parent 8fc2f0e commit 491a4a8

12 files changed

+28
-19
lines changed

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_causally_consistent_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ selector:
6060
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
6161
- jstests/core/query/explain/explain_uuid.js
6262
- jstests/core/query/explain/explain_includes_command.js
63-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
6463
- jstests/core/txns/transactions_profiling.js
6564
- jstests/core/txns/currentop_blocked_operations.js
6665
- jstests/core/txns/transactions_profiling_with_drops.js

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_replica_sets_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ selector:
5858
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
5959
- jstests/core/query/explain/explain_uuid.js
6060
- jstests/core/query/explain/explain_includes_command.js
61-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
6261
- jstests/core/txns/transactions_profiling.js
6362
- jstests/core/txns/currentop_blocked_operations.js
6463
- jstests/core/txns/transactions_profiling_with_drops.js

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_replica_sets_kill_stepdown_terminate_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ selector:
112112
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
113113
- jstests/core/query/explain/explain_uuid.js
114114
- jstests/core/query/explain/explain_includes_command.js
115-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
116115
- jstests/fle2/**/*.js
117116
- src/mongo/db/modules/*/jstests/fle2/**/*.js
118117
exclude_with_any_tags:

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_replica_sets_multi_stmt_txn_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ selector:
194194
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
195195
- jstests/core/query/explain/explain_uuid.js
196196
- jstests/core/query/explain/explain_includes_command.js
197-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
198197
- jstests/libs/txns/txn_passthrough_runner_selftest.js
199198
exclude_with_any_tags:
200199
- assumes_standalone_mongod

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_replica_sets_multi_stmt_txn_kill_stepdown_terminate_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ selector:
228228
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
229229
- jstests/core/query/explain/explain_uuid.js
230230
- jstests/core/query/explain/explain_includes_command.js
231-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
232231
exclude_with_any_tags:
233232
- assumes_standalone_mongod
234233
- requires_getmore

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_sharded_causally_consistent_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ selector:
8585
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
8686
- jstests/core/query/explain/explain_uuid.js
8787
- jstests/core/query/explain/explain_includes_command.js
88-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
8988
- jstests/core/txns/transactions_profiling.js
9089
- jstests/core/txns/currentop_blocked_operations.js
9190
- jstests/core/txns/transactions_profiling_with_drops.js

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_sharded_collections_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ selector:
8585
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
8686
- jstests/core/query/explain/explain_uuid.js
8787
- jstests/core/query/explain/explain_includes_command.js
88-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
8988
- jstests/core/txns/transactions_profiling.js
9089
- jstests/core/txns/currentop_blocked_operations.js
9190
- jstests/core/txns/transactions_profiling_with_drops.js

buildscripts/resmokeconfig/matrix_suites/generated_suites/bulk_write_sharded_multi_stmt_txn_jscore_passthrough.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ selector:
208208
- jstests/core/query/parsing/write_commands_reject_unknown_fields.js
209209
- jstests/core/query/explain/explain_uuid.js
210210
- jstests/core/query/explain/explain_includes_command.js
211-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
212211
- jstests/core/txns/transactions_profiling.js
213212
- jstests/core/txns/currentop_blocked_operations.js
214213
- jstests/core/txns/transactions_profiling_with_drops.js

buildscripts/resmokeconfig/matrix_suites/overrides/bulk_write.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
# Checks for specific name in the command that was executed that we override.
3434
- jstests/core/query/explain/explain_includes_command.js
3535

36-
# TODO: Remove this exclusion when SERVER-100924 is completed.
37-
- jstests/core/timeseries/write/timeseries_buckets_write_explain.js
38-
3936
- name: single_op_txns_excluded_files
4037
value:
4138
exclude_files:

jstests/core/timeseries/write/timeseries_buckets_write_explain.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,21 @@ assert.commandWorked(coll.insert([
2727

2828
const assertExplain = function(commandResult, commandName) {
2929
assert(commandResult.ok);
30-
assert.eq(commandResult.command[commandName],
31-
coll.getName(),
32-
`Expected command namespace to be ${tojson(coll.getName())} but got ${
33-
tojson(commandResult.command[commandName])}`);
34-
30+
if (commandResult.command.bulkWrite) {
31+
assert.eq(commandResult.command.nsInfo.length,
32+
1,
33+
`Expected 1 namespace in explain command but got ${
34+
commandResult.command.nsInfo.length}`);
35+
assert.eq(commandResult.command.nsInfo[0].ns,
36+
coll.getFullName(),
37+
`Expected command namespace to be ${tojson(coll.getFullName())} but got ${
38+
tojson(commandResult.command.nsInfo[0].ns)}`);
39+
} else {
40+
assert.eq(commandResult.command[commandName],
41+
coll.getName(),
42+
`Expected command namespace to be ${tojson(coll.getName())} but got ${
43+
tojson(commandResult.command[commandName])}`);
44+
}
3545
assert(commandResult.command.rawData);
3646
assert.isnull(getPlanStage(commandResult, "TS_MODIFY")),
3747
"Expected not to find TS_MODIFY stage " + tojson(commandResult);
@@ -47,8 +57,8 @@ assertExplain(coll.explain().remove({"control.count": 2}, {rawData: true}), "del
4757
assertExplain(coll.explain().update({"control.count": 1}, {$set: {meta: "3"}}, {rawData: true}),
4858
"update");
4959

50-
// Additionally run an explain that issues a cluster write without a shard key to test that
51-
// path.
60+
// Additionally run explains that issue a cluster write without a shard key in a sharded environment
61+
// to test that path.
5262
// TODO SERVER-102697: Cluster write without shard key for findAndModify (if not put into its own
5363
// test).
5464
assertExplain(coll.explain().remove({"control.count": 2}, {rawData: true, justOne: true}),

0 commit comments

Comments
 (0)