summaryrefslogtreecommitdiff
path: root/jstests/replsets/read_write_concern_defaults_propagation.js
blob: 5c96d1a4cf39cd4f3c4baef181b5619dfc5a6977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Tests propagation of RWC defaults across a replica set.
//
// @tags: [requires_fcv_44]
(function() {
'use strict';

load("jstests/libs/read_write_concern_defaults_propagation_common.js");

const rst = new ReplSetTest({nodes: 3});
rst.startSet();
rst.initiate();

const primary = rst.getPrimary();
const secondaries = rst.getSecondaries();

ReadWriteConcernDefaultsPropagation.runTests(primary, [primary, ...secondaries]);

// Verify the in-memory defaults are updated correctly. This verifies the cache is invalidated
// properly on secondaries when an update to the defaults document is replicated because the
// in-memory value will only be updated after an invalidation.
ReadWriteConcernDefaultsPropagation.runTests(
    primary, [primary, ...secondaries], true /* inMemory */);

ReadWriteConcernDefaultsPropagation.runDropAndDeleteTests(primary, [primary, ...secondaries]);

rst.stopSet();
})();