| Steps To Reproduce: |
Run the following test:
(function(){
|
let rs = new ReplSetTest({nodes:1});
|
rs.startSet();
|
rs.initiate();
|
|
let prim = rs.getPrimary();
|
let test = prim.getDB("test");
|
let local = prim.getDB("local");
|
|
test.x.drop();
|
test.x.insert({});
|
test.y.insert({});
|
let ts = local.oplog.rs.find().sort({$natural:-1}).limit(1).next().ts;
|
test.y.renameCollection("x", true);
|
|
ops = local.oplog.rs.find({ts:{$gt: ts}}).sort({$natural:1}).toArray();
|
assert.eq(ops.length, 1,
|
"renameCollection was supposed to only generate a single oplog entry: " + tojson(ops));
|
})();
|
Current output is:
assert: [2] != [1] are not equal : renameCollection was supposed to only generate a single oplog entry: [
|
{
|
"ts" : Timestamp(1489385287, 6),
|
"t" : NumberLong(1),
|
"h" : NumberLong("-3656781107160762734"),
|
"v" : 2,
|
"op" : "c",
|
"ns" : "test.$cmd",
|
"o" : {
|
"drop" : "x"
|
}
|
},
|
{
|
"ts" : Timestamp(1489385287, 7),
|
"t" : NumberLong(1),
|
"h" : NumberLong("-5606475750286919212"),
|
"v" : 2,
|
"op" : "c",
|
"ns" : "test.$cmd",
|
"o" : {
|
"renameCollection" : "test.y",
|
"to" : "test.x",
|
"stayTemp" : false,
|
"dropTarget" : true
|
}
|
}
|
]
|
|