mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
eb08c1db38
create mode 100644 jstests/replsets/reconfig_waits_for_oplog_commitment_condition.js create mode 100644 jstests/replsets/reconfig_waits_for_oplog_commitment_condition_when_leaving_force.js
31 lines
852 B
JavaScript
31 lines
852 B
JavaScript
// Test that if an afterClusterTime query is issued to a node in initial sync that has not yet
|
|
// created its oplog, the node returns an error rather than crashing.
|
|
(function() {
|
|
'use strict';
|
|
|
|
load("jstests/libs/fail_point_util.js");
|
|
|
|
const replSet = new ReplSetTest({nodes: 1});
|
|
|
|
replSet.startSet();
|
|
replSet.initiate();
|
|
const primary = replSet.getPrimary();
|
|
const secondary = replSet.add({rsConfig: {votes: 0, priority: 0}});
|
|
|
|
const failPoint = configureFailPoint(secondary, 'initialSyncHangBeforeCreatingOplog');
|
|
replSet.reInitiate();
|
|
|
|
failPoint.wait();
|
|
|
|
assert.commandFailedWithCode(
|
|
secondary.getDB('local').runCommand(
|
|
{find: 'coll', limit: 1, readConcern: {afterClusterTime: Timestamp(1, 1)}}),
|
|
ErrorCodes.NotYetInitialized);
|
|
|
|
failPoint.off();
|
|
|
|
replSet.awaitReplication();
|
|
replSet.awaitSecondaryNodes();
|
|
|
|
replSet.stopSet();
|
|
})(); |