Files
mongo/jstests/replsets/writes_wait_for_write_concern.js
Janna Golden 9fba299ed5 SERVER-100528 Add tests for all commands that accept write concern (#32349)
Co-authored-by: Abdul Qadeer <abdul.qadeer@mongodb.com>
GitOrigin-RevId: c4cb2d2985fb0f16aa60280e0e371c0b1d8d4e29
2025-04-09 22:14:52 +00:00

32 lines
1.1 KiB
JavaScript

/**
* This file tests that if a user initiates a write that becomes a noop either due to being a
* duplicate operation or due to errors relying on data reads, that we still wait for write concern.
* This is because we must wait for write concern on the write that made this a noop so that we can
* be sure it doesn't get rolled back if we acknowledge it.
*
* @tags: [
* multiversion_incompatible,
* uses_transactions,
* does_not_support_stepdowns,
* ]
*/
import {ReplSetTest} from "jstests/libs/replsettest.js";
import {
checkWriteConcernBehaviorAdditionalCRUDOps,
checkWriteConcernBehaviorForAllCommands
} from "jstests/libs/write_concern_all_commands.js";
const name = jsTestName();
const replTest = new ReplSetTest({
name: name,
nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}],
});
replTest.startSet();
replTest.initiate();
checkWriteConcernBehaviorForAllCommands(replTest.getPrimary(), replTest, "rs" /* clusterType */);
checkWriteConcernBehaviorAdditionalCRUDOps(replTest.getPrimary(), replTest, "rs" /* clusterType */);
replTest.stopSet();