summaryrefslogtreecommitdiff
path: root/jstests/serverless/change_stream_state_commands.js
diff options
context:
space:
mode:
authorMindaugas Malinauskas <mindaugas.malinauskas@mongodb.com>2023-04-04 18:27:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-04 20:13:45 +0000
commitb9d8a47872050ca5fe6c1b95fcb0534e6e0ebc3d (patch)
tree9b98862554a9fae6adcec426a076a649718ee28c /jstests/serverless/change_stream_state_commands.js
parentb584db7ad2e3256b37aa0191bb2b1215a7aff709 (diff)
downloadmongo-b9d8a47872050ca5fe6c1b95fcb0534e6e0ebc3d.tar.gz
SERVER-66715 Add tenant lock
Diffstat (limited to 'jstests/serverless/change_stream_state_commands.js')
-rw-r--r--jstests/serverless/change_stream_state_commands.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/serverless/change_stream_state_commands.js b/jstests/serverless/change_stream_state_commands.js
index c7196e7a104..f6fdcb6eb61 100644
--- a/jstests/serverless/change_stream_state_commands.js
+++ b/jstests/serverless/change_stream_state_commands.js
@@ -9,6 +9,10 @@
load("jstests/libs/fail_point_util.js"); // For configureFailPoint.
load('jstests/libs/parallel_shell_helpers.js'); // For funWithArgs.
+// Disable implicit sessions since dropping "config" database for a tenant must be done not in a
+// session.
+TestData.disableImplicitSessions = true;
+
const replSetTest =
new ReplSetTest({nodes: 2, name: "change-stream-state-commands", serverless: true});
@@ -104,6 +108,12 @@ const secondOrgTenantId = ObjectId();
setChangeStreamState(firstOrgTenantId, false);
setChangeStreamState(firstOrgTenantId, false);
assertChangeStreamState(firstOrgTenantId, false);
+
+ // Verify that dropping "config" database works and effectively disables change streams.
+ setChangeStreamState(firstOrgTenantId, true);
+ assert.commandWorked(replSetTest.getPrimary().getDB("config").runCommand(
+ {dropDatabase: 1, $tenant: firstOrgTenantId}));
+ assertChangeStreamState(firstOrgTenantId, false);
})();
// Tests that the 'setChangeStreamState' command tolerates the primary step-down and can
@@ -302,4 +312,5 @@ const secondOrgTenantId = ObjectId();
})();
replSetTest.stopSet();
+TestData.disableImplicitSessions = false;
}());