summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2018-05-25 12:10:05 -0400
committerJudah Schvimer <judah@mongodb.com>2018-05-25 13:40:16 -0400
commit3023c89e9c557c23726b80e2c0d4acd007dc217d (patch)
tree9e4190d451b5750c4131e2a18700e9e603101a5a
parente3ce1c27fd0a3358b18059a8e7ac63aee3ad10f0 (diff)
downloadmongo-3023c89e9c557c23726b80e2c0d4acd007dc217d.tar.gz
SERVER-35229 Improve logging in apply_batch_only_goes_forward.js
(cherry picked from commit 1d6020782c4e43badbc2d00b38cff7ceaa61a6eb)
-rw-r--r--jstests/replsets/apply_batch_only_goes_forward.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/jstests/replsets/apply_batch_only_goes_forward.js b/jstests/replsets/apply_batch_only_goes_forward.js
index c3da197f557..b0916de129d 100644
--- a/jstests/replsets/apply_batch_only_goes_forward.js
+++ b/jstests/replsets/apply_batch_only_goes_forward.js
@@ -54,6 +54,7 @@ TestData.skipCheckDBHashes = true;
var farFutureTS = new Timestamp(
Math.floor(new Date().getTime() / 1000) + (60 * 60 * 24 * 5 /* in five days*/), 0);
var rsgs = assert.commandWorked(mLocal.adminCommand("replSetGetStatus"));
+ jsTestLog("Using replSetGetStatus to set minValid: " + tojson(rsgs));
var primaryOpTime = rsgs.members
.filter(function(member) {
return member.self;
@@ -64,9 +65,12 @@ TestData.skipCheckDBHashes = true;
// We do an update in case there is a minvalid document on the primary already.
// If the doc doesn't exist then upsert:true will create it, and the writeConcern ensures
// that update returns details of the write, like whether an update or insert was performed.
+ const minValidUpdate = {ts: farFutureTS, t: NumberLong(-1), begin: primaryOpTime};
+ jsTestLog("Current minvalid is " + tojson(mMinvalid.findOne()));
+ jsTestLog("Updating minValid to: " + tojson(minValidUpdate));
printjson(assert.writeOK(mMinvalid.update(
{},
- {ts: farFutureTS, t: NumberLong(-1), begin: primaryOpTime},
+ minValidUpdate,
{upsert: true, writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}})));
jsTest.log('Restarting primary ' + master.host +