diff options
author | Benety Goh <benety@mongodb.com> | 2016-02-16 16:37:32 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-02-17 09:37:45 -0500 |
commit | 1a74a81b6eb2ad4b3fdd30408b522826aa08610c (patch) | |
tree | ab17fc8528c8d95fdff5ec681bb3cb70142aeadd /jstests/replsets | |
parent | ff8ca92aafd08c17f93bf00bf7aeaac79643ad02 (diff) | |
download | mongo-1a74a81b6eb2ad4b3fdd30408b522826aa08610c.tar.gz |
SERVER-22679 fixed rollback_fake_cmd.js oplog entry to ensure fake command name is reported in logs.
Diffstat (limited to 'jstests/replsets')
-rw-r--r-- | jstests/replsets/rollback_fake_cmd.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/jstests/replsets/rollback_fake_cmd.js b/jstests/replsets/rollback_fake_cmd.js index 59e761b4c76..b624a8ea80e 100644 --- a/jstests/replsets/rollback_fake_cmd.js +++ b/jstests/replsets/rollback_fake_cmd.js @@ -53,10 +53,11 @@ options = {writeConcern: {w: 1, wtimeout: 60000}, upsert: true}; // another insert to set minvalid ahead assert.writeOK(b_conn.getDB(name).foo.insert({x: 123})); var oplog_entry = b_conn.getDB("local").oplog.rs.find().sort({$natural: -1})[0]; -oplog_entry["ts"] = Timestamp(oplog_entry["ts"].t, oplog_entry["ts"].i + 1); -oplog_entry["op"] = "c"; -oplog_entry["cmd"] = "fake_command_name.exe"; +oplog_entry.ts = Timestamp(oplog_entry.ts.t, oplog_entry.ts.i + 1); +oplog_entry.op = "c"; +oplog_entry.o = {fake_command_name: 1}; assert.writeOK(b_conn.getDB("local").oplog.rs.insert(oplog_entry)); +jsTestLog('inserted oplog entry with invalid command: ' + tojson(oplog_entry)); // shut down B and bring back the original master replTest.stop(BID); @@ -71,7 +72,7 @@ assert.writeOK(a_conn.getDB(name).foo.insert({x: 2}, options)); // restart B, which should rollback and log a message about not rolling back the nonexistent cmd clearRawMongoProgramOutput(); replTest.restart(BID); -var msg = RegExp("rollback no such command "); +var msg = RegExp("rollback no such command fake_command_name"); assert.soon(function() { return rawMongoProgramOutput().match(msg); }, "Did not see a log entry about skipping the nonexistent command during rollback"); |