summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIrina Yatsenko <irina.yatsenko@mongodb.com>2021-06-04 22:12:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-15 22:26:55 +0000
commitb8ffbe6748bcb150d2c818bce72d19fdcd4787d4 (patch)
treeb7c0fb3ceee964215f8e314b238419cc104289df
parent2c63d9bb562aaaf72e11233e5efcd42f5dfd4085 (diff)
downloadmongo-b8ffbe6748bcb150d2c818bce72d19fdcd4787d4.tar.gz
SERVER-57456 Remove jstests that explicitly validate getLastError functionality
-rw-r--r--buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_kill_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_reconfig_kill_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml4
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml2
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml4
-rw-r--r--buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml4
-rw-r--r--jstests/auth/lib/commands_lib.js10
-rw-r--r--jstests/core/bulk_legacy_enforce_gle.js125
-rw-r--r--jstests/libs/parallelTester.js5
-rw-r--r--jstests/noPassthroughWithMongod/insertMulti.js20
-rw-r--r--jstests/replsets/apply_ops_lastop.js52
-rw-r--r--jstests/replsets/last_error_reported_after_stepdown.js134
-rw-r--r--jstests/replsets/lastop.js126
-rw-r--r--jstests/replsets/stepdown3.js54
-rw-r--r--jstests/sharding/authCommands.js3
-rw-r--r--jstests/sharding/bulk_insert.js6
32 files changed, 11 insertions, 574 deletions
diff --git a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml
index 33704775f39..1b97d8ce066 100644
--- a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml
@@ -76,7 +76,6 @@ selector:
- jstests/core/and.js
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -150,7 +149,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml
index 118a7cb6efb..fd7413e5cec 100644
--- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml
@@ -75,7 +75,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -165,7 +164,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml
index adfcbfb8cfe..bdfd2a1804a 100644
--- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml
@@ -75,7 +75,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -160,7 +159,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml
index 3aad76dc09c..b9e519ddb13 100644
--- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml
@@ -75,7 +75,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -161,7 +160,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml
index 8e6e002333a..5a38c4f1372 100644
--- a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml
+++ b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml
@@ -80,7 +80,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -173,7 +172,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_kill_primary_jscore_passthrough.yml
index 6865443484a..14baa21151d 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_kill_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_kill_primary_jscore_passthrough.yml
@@ -16,8 +16,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml
index 13b15a3d081..d00118acabb 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml
@@ -16,7 +16,6 @@ selector:
- jstests/core/api_params_getmore.js
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -113,7 +112,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml
index 40650b6e04b..7c0de2a2f1e 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml
@@ -14,7 +14,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -101,7 +100,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml
index 330171262db..938e3a34549 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml
@@ -14,7 +14,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -100,7 +99,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml
index 6acd3672558..0376c24d261 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml
@@ -14,7 +14,6 @@ selector:
# These tests expects some statements to error, which will cause txns to abort entirely.
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -98,7 +97,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml
index 60e8df659c3..9d3b5ecbbc1 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml
@@ -24,8 +24,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_kill_primary_jscore_passthrough.yml
index 990b5da3df9..f8a46e17abf 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_kill_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_kill_primary_jscore_passthrough.yml
@@ -25,8 +25,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml
index dd6d85d1b66..5ba3f567d9d 100644
--- a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml
@@ -16,8 +16,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml
index 5e119f89394..8f57a5eec15 100644
--- a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml
@@ -22,8 +22,6 @@ selector:
- jstests/core/invalidated_legacy_cursors.js
- jstests/core/validate_cmd_ns.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml
index 5d218b3f65a..21a7a4024ef 100644
--- a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml
@@ -16,8 +16,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml
index 9dac296e328..275cd2a0b96 100644
--- a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml
@@ -48,7 +48,6 @@ selector:
- jstests/core/api_params_getmore.js
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/commands_with_uuid.js
- jstests/core/dbcase.js
- jstests/core/dbcase2.js
@@ -137,7 +136,6 @@ selector:
# to test run without multi statement transactions).
- jstests/core/bulk_api_ordered.js
- jstests/core/bulk_api_unordered.js
- - jstests/core/bulk_legacy_enforce_gle.js
- jstests/core/doc_validation.js
- jstests/core/doc_validation_options.js
- jstests/core/field_name_validation.js
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml
index edc3c0b8214..172d8dd47ff 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml
@@ -65,8 +65,6 @@ selector:
# These tests use legacy read mode which does not use runCommand.
- jstests/core/comment_field.js
- jstests/core/invalidated_legacy_cursors.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml
index 54ea78fdf57..3cf48d9f256 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml
@@ -88,8 +88,6 @@ selector:
- jstests/core/views/invalid_system_views.js
- jstests/core/views/views_all_commands.js
- jstests/core/rename_collection_staytemp.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml
index aaabc652193..139d51dd3f8 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml
@@ -64,8 +64,6 @@ selector:
# These tests use legacy read mode which does not use runCommand.
- jstests/core/comment_field.js
- jstests/core/invalidated_legacy_cursors.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
@@ -112,8 +110,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml
index edcebda085d..34d0d26b8cf 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml
@@ -68,8 +68,6 @@ selector:
# These tests use legacy read mode which does not use runCommand.
- jstests/core/comment_field.js
- jstests/core/invalidated_legacy_cursors.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml
index b6929676ec9..724989feb7b 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml
@@ -64,8 +64,6 @@ selector:
# These tests use legacy read mode which does not use runCommand.
- jstests/core/comment_field.js
- jstests/core/invalidated_legacy_cursors.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
@@ -112,8 +110,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml
index e5df514ae16..91a4acce06a 100644
--- a/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml
@@ -64,8 +64,6 @@ selector:
# These tests use legacy read mode which does not use runCommand.
- jstests/core/comment_field.js
- jstests/core/invalidated_legacy_cursors.js
- # TODO (SERVER-52866): Synchronize getLastError with tenant migrations.
- - jstests/core/bulk_legacy_enforce_gle.js
# This test contains assertions for the hostname that operations run on.
- jstests/core/currentop_cursors.js
# Server parameters are stored in-memory only so are not transferred onto the recipient. These
@@ -112,8 +110,6 @@ selector:
- jstests/core/top.js
- jstests/core/views/views_stats.js
- - jstests/core/bulk_legacy_enforce_gle.js
-
# TODO SERVER-31242: findAndModify no-op retry should respect the fields option.
- jstests/core/crud_api.js
- jstests/core/find_and_modify.js
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js
index 643cfafe03b..6ffd992d28e 100644
--- a/jstests/auth/lib/commands_lib.js
+++ b/jstests/auth/lib/commands_lib.js
@@ -4137,14 +4137,6 @@ var authCommandsLib = {
}]
},
{
- testname: "getLastError",
- command: {getLastError: 1},
- testcases: [
- {runOnDb: firstDbName, roles: roles_all, privileges: []},
- {runOnDb: secondDbName, roles: roles_all, privileges: []}
- ]
- },
- {
testname: "getLog",
command: {getLog: "*"},
testcases: [
@@ -6305,7 +6297,6 @@ var authCommandsLib = {
if (t.setup) {
adminDb.auth("admin", "password");
var state = t.setup(runOnDb, testcase);
- runOnDb.getLastError();
adminDb.logout();
return state;
}
@@ -6324,7 +6315,6 @@ var authCommandsLib = {
if (t.teardown) {
adminDb.auth("admin", "password");
t.teardown(runOnDb, response);
- runOnDb.getLastError();
adminDb.logout();
}
},
diff --git a/jstests/core/bulk_legacy_enforce_gle.js b/jstests/core/bulk_legacy_enforce_gle.js
deleted file mode 100644
index e9def78d241..00000000000
--- a/jstests/core/bulk_legacy_enforce_gle.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Tests the resetError logic when the bulk api enforces the write concern for unordered
- * writes. The tests indirectly checks whether resetError was called by inspecting the
- * response of the getLastError command after executing the bulk ops.
- *
- */
-
-(function() {
-"use strict";
-const coll = db.bulk_legacy_enforce_gle;
-
-/**
- * Inserts 'doc' into the collection, asserting that the write succeeds. This runs a
- * getLastError if the insert does not return a response.
- */
-function insertDocument(doc) {
- let res = coll.insert(doc);
- if (res) {
- assert.commandWorked(res);
- } else {
- assert.gleOK(db.runCommand({getLastError: 1}));
- }
-}
-
-coll.drop();
-let bulk = coll.initializeUnorderedBulkOp();
-bulk.find({_id: 1}).upsert().updateOne({_id: 1});
-assert.commandWorked(bulk.execute());
-let gle = assert.gleOK(db.runCommand({getLastError: 1}));
-assert.eq(1, gle.n, tojson(gle));
-
-// Batch of size 1 should not call resetError even when it errors out.
-assert(coll.drop());
-insertDocument({_id: 1});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({none: 1}).upsert().updateOne({_id: 1});
-assert.throws(function() {
- bulk.execute();
-});
-
-gle = db.runCommand({getLastError: 1});
-assert(gle.ok, tojson(gle));
-assert.neq(null, gle.err, tojson(gle));
-
-// Batch with all error except last should not call resetError.
-assert(coll.drop());
-insertDocument({_id: 1});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({none: 1}).upsert().updateOne({_id: 1});
-bulk.find({none: 1}).upsert().updateOne({_id: 1});
-bulk.find({_id: 0}).upsert().updateOne({_id: 0});
-let res = assert.throws(function() {
- bulk.execute();
-});
-assert.eq(2, res.getWriteErrors().length);
-
-gle = db.runCommand({getLastError: 1});
-assert(gle.ok, tojson(gle));
-assert.eq(1, gle.n, tojson(gle));
-
-// Batch with error at middle should not call resetError.
-assert(coll.drop());
-insertDocument({_id: 1});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({_id: 0}).upsert().updateOne({_id: 0});
-bulk.find({none: 1}).upsert().updateOne({_id: 1});
-bulk.find({_id: 2}).upsert().updateOne({_id: 2});
-res = assert.throws(function() {
- bulk.execute();
-});
-assert.eq(1, res.getWriteErrors().length);
-
-gle = db.runCommand({getLastError: 1});
-assert(gle.ok, tojson(gle));
-// For legacy writes, mongos sends the bulk as one while the shell sends the write individually.
-assert.gte(gle.n, 1, tojson(gle));
-
-// Batch with error at last should call resetError.
-assert(coll.drop());
-insertDocument({_id: 2});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({_id: 0}).upsert().updateOne({_id: 0});
-bulk.find({_id: 1}).upsert().updateOne({_id: 1});
-bulk.find({none: 1}).upsert().updateOne({_id: 2});
-res = assert.throws(function() {
- bulk.execute();
-});
-assert.eq(1, res.getWriteErrors().length);
-
-gle = db.runCommand({getLastError: 1});
-assert(gle.ok, tojson(gle));
-assert.eq(0, gle.n, tojson(gle));
-
-// Batch with error at last should not call resetError if { w: 1 }.
-assert(coll.drop());
-insertDocument({_id: 2});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({_id: 0}).upsert().updateOne({_id: 0});
-bulk.find({_id: 1}).upsert().updateOne({_id: 1});
-bulk.find({none: 1}).upsert().updateOne({_id: 2});
-res = assert.throws(function() {
- bulk.execute();
-});
-assert.eq(1, res.getWriteErrors().length);
-
-gle = db.runCommand({getLastError: 1, w: 1});
-assert(gle.ok, tojson(gle));
-assert.neq(null, gle.err, tojson(gle));
-
-// Batch with error at last should not call resetError if { w: 0 }.
-assert(coll.drop());
-insertDocument({_id: 2});
-bulk = coll.initializeUnorderedBulkOp();
-bulk.find({_id: 0}).upsert().updateOne({_id: 0});
-bulk.find({_id: 1}).upsert().updateOne({_id: 1});
-bulk.find({none: 1}).upsert().updateOne({_id: 2});
-res = assert.throws(function() {
- bulk.execute();
-});
-assert.eq(1, res.getWriteErrors().length, () => tojson(res));
-
-gle = db.runCommand({getLastError: 1, w: 0});
-assert(gle.ok, tojson(gle));
-assert.neq(null, gle.err, tojson(gle));
-}());
diff --git a/jstests/libs/parallelTester.js b/jstests/libs/parallelTester.js
index a898503d345..0ed7c125976 100644
--- a/jstests/libs/parallelTester.js
+++ b/jstests/libs/parallelTester.js
@@ -164,11 +164,6 @@ if (typeof _threadInject != "undefined") {
"run_program1.js",
"bench_test1.js",
- // These tests use the getLastError command, which is unsafe to use in this environment,
- // since a previous test's cursors could be garbage collected in the middle of the next
- // test, which would reset the last error associated with the shell's client.
- "bulk_legacy_enforce_gle.js",
-
// These tests use getLog to examine the logs. Tests which do so shouldn't be run in
// this suite because any test being run at the same time could conceivably spam the
// logs so much that the line they are looking for has been rotated off the server's
diff --git a/jstests/noPassthroughWithMongod/insertMulti.js b/jstests/noPassthroughWithMongod/insertMulti.js
index 2e09e799a2f..4715199127d 100644
--- a/jstests/noPassthroughWithMongod/insertMulti.js
+++ b/jstests/noPassthroughWithMongod/insertMulti.js
@@ -16,23 +16,24 @@ function makeDocument(docSize) {
return doc;
}
-db.getMongo().forceWriteMode('legacy');
var t = db.foo;
t.drop();
-t.insert([{_id: 1}, {_id: 2}]);
+assert.commandWorked(t.insert([{_id: 1}, {_id: 2}]));
assert.eq(t.count(), 2);
-t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 0); // no ContinueOnError
+// no ContinueOnError
+assert.commandFailedWithCode(t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 0), ErrorCodes.DuplicateKey);
assert.eq(t.count(), 3);
assert.eq(t.count({"_id": 1}), 1);
assert.eq(t.count({"_id": 2}), 1);
assert.eq(t.count({"_id": 3}), 1);
assert.eq(t.count({"_id": 4}), 0);
-t.drop();
-t.insert([{_id: 1}, {_id: 2}]);
+assert(t.drop());
+assert.commandWorked(t.insert([{_id: 1}, {_id: 2}]));
assert.eq(t.count(), 2);
-t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 1); // ContinueOnError
+// ContinueOnError
+assert.commandFailedWithCode(t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 1), ErrorCodes.DuplicateKey);
assert.eq(t.count(), 4);
assert.eq(t.count({"_id": 1}), 1);
assert.eq(t.count({"_id": 2}), 1);
@@ -40,14 +41,13 @@ assert.eq(t.count({"_id": 3}), 1);
assert.eq(t.count({"_id": 4}), 1);
// Push a large vector in bigger than the subset size we'll break it up into
-t.drop();
+assert(t.drop());
var doc = makeDocument(16 * 1024);
var docs = [];
for (var i = 0; i < 1000; i++)
docs.push(Object.extend({}, doc));
-t.insert(docs);
-assert.eq(null, t.getDB().getLastError());
+assert.commandWorked(t.insert(docs));
assert.eq(t.count(), docs.length);
-t.drop();
+assert(t.drop());
})();
diff --git a/jstests/replsets/apply_ops_lastop.js b/jstests/replsets/apply_ops_lastop.js
deleted file mode 100644
index c6257fe907c..00000000000
--- a/jstests/replsets/apply_ops_lastop.js
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// Test that last optime is updated properly when the applyOps command fails and there's a no-op.
-// lastOp is used as the optime to wait for when write concern waits for replication.
-//
-
-(function() {
-"use strict";
-
-var rs = new ReplSetTest({name: "applyOpsOptimeTest", nodes: 3, waitForKeys: true});
-rs.startSet();
-var nodes = rs.nodeList();
-rs.initiate({
- "_id": "applyOpsOptimeTest",
- "members": [
- {"_id": 0, "host": nodes[0]},
- {"_id": 1, "host": nodes[1]},
- {"_id": 2, "host": nodes[2], "arbiterOnly": true}
- ]
-});
-var primary = rs.getPrimary();
-var db = primary.getDB('foo');
-var coll = primary.getCollection('foo.bar');
-// Two connections
-var m1 = new Mongo(primary.host);
-var m2 = new Mongo(primary.host);
-
-var insertApplyOps = [{op: "i", ns: 'foo.bar', o: {_id: 1, a: "b"}}];
-var deleteApplyOps = [{op: "d", ns: 'foo.bar', o: {_id: 1, a: "b"}}];
-var badPreCondition = [{ns: 'foo.bar', q: {_id: 10, a: "aaa"}, res: {a: "aaa"}}];
-var majorityWriteConcern = {w: 'majority', wtimeout: 30000};
-
-// Set up some data
-assert.commandWorked(coll.insert({x: 1})); // creating the collection so applyOps works
-assert.commandWorked(
- m1.getDB('foo').runCommand({applyOps: insertApplyOps, writeConcern: majorityWriteConcern}));
-var insertOp = m1.getDB('foo').getLastErrorObj('majority', 30000).lastOp;
-
-// No-op applyOps
-var res = m2.getDB('foo').runCommand(
- {applyOps: deleteApplyOps, preCondition: badPreCondition, writeConcern: majorityWriteConcern});
-assert.commandFailed(res, "The applyOps command was expected to fail, but instead succeeded.");
-assert.eq(res.errmsg, "preCondition failed", "The applyOps command failed for the wrong reason.");
-var noOp = m2.getDB('foo').getLastErrorObj('majority', 30000).lastOp;
-
-// Check that each connection has the same last optime
-assert.eq(noOp,
- insertOp,
- "The connections' last optimes do " +
- "not match: applyOps failed to update lastop on no-op");
-
-rs.stopSet();
-})();
diff --git a/jstests/replsets/last_error_reported_after_stepdown.js b/jstests/replsets/last_error_reported_after_stepdown.js
deleted file mode 100644
index be7d81b7574..00000000000
--- a/jstests/replsets/last_error_reported_after_stepdown.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * Tests that writes which complete before stepdown correctly report their errors after the
- * stepdown.
- */
-load("jstests/libs/logv2_helpers.js");
-
-(function() {
-"use strict";
-
-const rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0}}]});
-rst.startSet();
-rst.initiate();
-
-const primary = rst.getPrimary();
-const primaryAdmin = primary.getDB("admin");
-// We need a separate connection to avoid interference with the ReplSetTestMechanism.
-const primaryDataConn = new Mongo(primary.host);
-const primaryDb = primaryDataConn.getDB("test");
-const collname = "last_error_reported_after_stepdown";
-const coll = primaryDb[collname];
-
-// Never retry on network error, because this test needs to detect the network error.
-TestData.skipRetryOnNetworkError = true;
-
-// This is specifically testing unacknowledged legacy writes.
-primaryDataConn.forceWriteMode('legacy');
-
-assert.commandWorked(
- coll.insert([{_id: 'deleteme'}, {_id: 'updateme', nullfield: null}, {_id: 'findme'}],
- {writeConcern: {w: 1}}));
-rst.awaitReplication();
-
-function getLogMsgFilter(isJson, command, collection) {
- if (isJson) {
- command = command.replace(/ /g, "");
- let logMsg = `"type":"${command}",`;
- if (collection != undefined) {
- logMsg += `"ns":"${collection}",`;
- } else {
- logMsg += '.*';
- }
- logMsg += '"appName":"MongoDB Shell",';
- return RegExp(logMsg);
- }
-
- let logMsg = command;
- if (collection != undefined) {
- logMsg += collection;
- }
- return logMsg + ' appName: "MongoDB Shell"';
-}
-
-// Note that "operation" should always be on primaryDataConn, so the stepdown doesn't clear
-// the last error.
-function runStepDownTest({description, logCommand, logCollection, operation, errorCode, nDocs}) {
- jsTestLog(`Trying ${description} on the primary, then stepping down`);
- // We need to make sure the command is complete before stepping down.
- assert.commandWorked(
- primaryAdmin.adminCommand({setParameter: 1, logComponentVerbosity: {command: 1}}));
- operation();
- // Wait for the operation to complete.
- checkLog.contains(primary, getLogMsgFilter(isJsonLog(primary), logCommand, logCollection));
- assert.commandWorked(
- primaryAdmin.adminCommand({setParameter: 1, logComponentVerbosity: {command: 0}}));
- assert.commandWorked(primaryAdmin.adminCommand({replSetStepDown: 60, force: true}));
- rst.waitForState(primary, ReplSetTest.State.SECONDARY);
- var lastError = assert.commandWorked(primaryDb.runCommand({getLastError: 1}));
- if (typeof (errorCode) == "number")
- assert.eq(
- lastError.code,
- errorCode,
- "Expected error code " + errorCode + ", got lastError of " + JSON.stringify(lastError));
- else {
- assert(!lastError.err, "Expected no error, got lastError of " + JSON.stringify(lastError));
- }
- if (typeof (nDocs) == "number") {
- assert.eq(lastError.n, nDocs, "Wrong number of documents modified or updated");
- }
-
- // Allow the primary to be re-elected, and wait for it.
- assert.commandWorked(primaryAdmin.adminCommand({replSetFreeze: 0}));
- rst.getPrimary();
-}
-
-// Tests which should have no errors.
-// Clear log messages to avoid picking up the log of the insertion of the 'deleteme'
-// document.
-assert.commandWorked(primaryAdmin.adminCommand({clearLog: 'global'}));
-runStepDownTest({
- description: "insert",
- logCommand: "insert ",
- logCollection: coll.getFullName(),
- operation: () => coll.insert({_id: 0})
-});
-runStepDownTest({
- description: "update",
- logCommand: "update ",
- operation: () => coll.update({_id: 'updateme'}, {'$inc': {x: 1}}),
- nDocs: 1
-});
-runStepDownTest({
- description: "remove",
- logCommand: "remove ",
- operation: () => coll.remove({_id: 'deleteme'}),
- nDocs: 1
-});
-
-// Tests which should have errors.
-// We repeat log messages from tests above, so clear the log first.
-assert.commandWorked(primaryAdmin.adminCommand({clearLog: 'global'}));
-runStepDownTest({
- description: "insert with error",
- logCommand: "insert ",
- logCollection: coll.getFullName(),
- operation: () => coll.insert({_id: 0}),
- errorCode: ErrorCodes.DuplicateKey
-});
-runStepDownTest({
- description: "update with error",
- logCommand: "update ",
- operation: () => coll.update({_id: 'updateme'}, {'$inc': {nullfield: 1}}),
- errorCode: ErrorCodes.TypeMismatch,
- nDocs: 0
-});
-runStepDownTest({
- description: "remove with error",
- logCommand: "remove ",
- operation: () => coll.remove({'$nonsense': {x: 1}}),
- errorCode: ErrorCodes.BadValue,
- nDocs: 0
-});
-
-rst.stopSet();
-})();
diff --git a/jstests/replsets/lastop.js b/jstests/replsets/lastop.js
deleted file mode 100644
index 87c52f4f04d..00000000000
--- a/jstests/replsets/lastop.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Test that lastOp is updated properly in the face of no-op writes and for writes that generate
-// errors based on the preexisting data (e.g. duplicate key errors, but not parse errors).
-// lastOp is used as the optime to wait for when write concern waits for replication.
-(function() {
-var replTest = new ReplSetTest({name: 'testSet', nodes: 1});
-replTest.startSet();
-replTest.initiate();
-
-var primary = replTest.getPrimary();
-
-// Two connections
-var m1 = new Mongo(primary.host);
-var m2 = new Mongo(primary.host);
-
-// Do a write with m1, then a write with m2, then a no-op write with m1. m1 should have a lastOp
-// of m2's write.
-
-assert.commandWorked(m1.getCollection("test.foo").insert({m1: 1}));
-var firstOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 99}));
-var secondOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// No-op update
-assert.commandWorked(m1.getCollection("test.foo").update({m1: 1}, {$set: {m1: 1}}));
-var noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, secondOp);
-
-assert.commandWorked(m1.getCollection("test.foo").remove({m1: 1}));
-var thirdOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 98}));
-var fourthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// No-op delete
-assert.commandWorked(m1.getCollection("test.foo").remove({m1: 1}));
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, fourthOp);
-
-// Dummy write, for a new lastOp.
-assert.commandWorked(m1.getCollection("test.foo").insert({m1: 99}));
-var fifthOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 97}));
-var sixthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// No-op find-and-modify delete
-m1.getCollection("test.foo").findAndModify({query: {m1: 1}, remove: true});
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, sixthOp);
-
-assert.commandWorked(m1.getCollection("test.foo").createIndex({x: 1}));
-var seventhOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 96}));
-var eighthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// No-op create index.
-assert.commandWorked(m1.getCollection("test.foo").createIndex({x: 1}));
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, eighthOp);
-
-assert.commandWorked(m1.getCollection("test.foo").insert({_id: 1, x: 1}));
-var ninthOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 991}));
-var tenthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// update with immutable field error
-assert.writeError(m1.getCollection("test.foo").update({_id: 1, x: 1}, {$set: {_id: 2}}));
-// "After applying the update to the document {_id: 1.0 , ...}, the (immutable) field '_id'
-// was found to have been altered to _id: 2.0"
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, tenthOp);
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 992}));
-var eleventhOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// find-and-modify immutable field error
-try {
- m1.getCollection("test.foo").findAndModify({query: {_id: 1, x: 1}, update: {$set: {_id: 2}}});
- // The findAndModify shell helper should throw.
- assert(false);
-} catch (e) {
- assert.eq(e.code, 66);
-}
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, eleventhOp);
-
-var bigString = new Array(3000).toString();
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 994, m3: bigString}));
-
-// No-op insert
-assert.commandWorked(m1.getCollection("test.foo").insert({_id: 5, x: 5}));
-var thirteenthOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.commandWorked(m2.getCollection("test.foo").insert({m2: 991}));
-var fourteenthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-// Hits DuplicateKey error and fails insert -- no-op
-assert.writeError(m1.getCollection("test.foo").insert({_id: 5, x: 5}));
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-assert.eq(noOp, fourteenthOp);
-
-// Test update and delete failures in legacy write mode.
-m2.forceWriteMode('legacy');
-m1.forceWriteMode('legacy');
-m2.getCollection("test.foo").insert({m2: 995});
-var fifthteenthOp = m2.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-
-m1.getCollection("test.foo").remove({m1: 1});
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-assert.eq(noOp, fifthteenthOp);
-
-m1.getCollection("test.foo").update({m1: 1}, {$set: {m1: 4}});
-noOp = m1.getCollection("test.foo").getDB().getLastErrorObj().lastOp;
-assert.eq(noOp, fifthteenthOp);
-replTest.stopSet();
-})();
diff --git a/jstests/replsets/stepdown3.js b/jstests/replsets/stepdown3.js
deleted file mode 100644
index 8852b44fdb5..00000000000
--- a/jstests/replsets/stepdown3.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Test that GLE asserts when the primary steps down while we're waiting for a replicated write.
-//
-// This test requires the fsync command to force a secondary to be stale.
-// @tags: [requires_fsync]
-(function() {
-'use strict';
-
-var replTest = new ReplSetTest({name: 'testSet', nodes: 2});
-var nodes = replTest.startSet();
-replTest.initiate();
-var primary = replTest.getPrimary();
-
-// The default WC is majority and fsyncLock will prevent satisfying any majority writes.
-assert.commandWorked(primary.adminCommand(
- {setDefaultRWConcern: 1, defaultWriteConcern: {w: 1}, writeConcern: {w: "majority"}}));
-
-// do a write to allow stepping down of the primary;
-// otherwise, the primary will refuse to step down
-print("\ndo a write");
-primary.getDB("test").foo.insert({x: 1});
-replTest.awaitReplication();
-
-// do another write, because the first one might be longer than 10 seconds ago
-// on the secondary (due to starting up), and we need to be within 10 seconds
-// to step down.
-var options = {writeConcern: {w: 2, wtimeout: 30000}};
-assert.commandWorked(primary.getDB("test").foo.insert({x: 2}, options));
-// lock secondary, to pause replication
-print("\nlock secondary");
-var locked = replTest.getSecondary();
-printjson(locked.getDB("admin").runCommand({fsync: 1, lock: 1}));
-
-// do a write
-print("\ndo a write");
-primary.getDB("test").foo.insert({x: 3});
-
-// step down the primary asyncronously
-print("stepdown");
-var command =
- "sleep(4000); assert.commandWorked(db.adminCommand( { replSetStepDown : 60, force : 1 } ));";
-var awaitShell = startParallelShell(command, primary.port);
-
-print("getlasterror; should return an error");
-let result = primary.getDB("test").runCommand({getLastError: 1, w: 2, wtimeout: 10 * 60 * 1000});
-assert(ErrorCodes.isNotPrimaryError(result.code));
-print("result of gle:");
-printjson(result);
-
-awaitShell();
-
-// unlock and shut down
-printjson(locked.getDB("admin").fsyncUnlock());
-replTest.stopSet();
-})();
diff --git a/jstests/sharding/authCommands.js b/jstests/sharding/authCommands.js
index 041542face9..8d8e80e92c7 100644
--- a/jstests/sharding/authCommands.js
+++ b/jstests/sharding/authCommands.js
@@ -127,9 +127,6 @@ var checkReadOps = function(hasReadAuth) {
assert.eq(expectedDocs, testDB.foo.find().itcount());
assert.eq(expectedDocs, testDB.foo.count());
- // NOTE: This is an explicit check that GLE can be run with read prefs, not the result
- // of above.
- assert.eq(null, testDB.runCommand({getlasterror: 1}).err);
checkCommandSucceeded(testDB, {dbstats: 1});
checkCommandSucceeded(testDB, {collstats: 'foo'});
diff --git a/jstests/sharding/bulk_insert.js b/jstests/sharding/bulk_insert.js
index a36c7c6c091..c3ca67f026f 100644
--- a/jstests/sharding/bulk_insert.js
+++ b/jstests/sharding/bulk_insert.js
@@ -204,9 +204,6 @@ var inserts = (function() {
];
})();
-var staleMongosWithLegacyWrites = new Mongo(staleMongos.name);
-staleMongosWithLegacyWrites.forceWriteMode('legacy');
-
staleCollSh = staleMongos.getCollection(collSh + "");
assert.eq(null, staleCollSh.findOne(), 'Collections should be empty');
@@ -215,8 +212,7 @@ assert.commandWorked(admin.runCommand(
assert.commandWorked(admin.runCommand(
{moveChunk: collSh + "", find: {ukey: 0}, to: st.shard0.shardName, _waitForDelete: true}));
-staleCollSh.insert(inserts);
-staleCollSh.getDB().getLastError();
+assert.commandWorked(staleCollSh.insert(inserts));
st.stop();
})();