diff options
author | Benety Goh <benety@mongodb.com> | 2019-01-09 13:54:38 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2019-01-09 13:54:52 -0500 |
commit | 627853bdc19ed147fe5c14e9e458035598c062ea (patch) | |
tree | 8a242f4f84098463def9b828ca9fc49617497d4c /jstests | |
parent | 722f06f3217c029ef9c50062c8cc775966fd7ead (diff) | |
download | mongo-627853bdc19ed147fe5c14e9e458035598c062ea.tar.gz |
SERVER-38800 add collection count to o2 field of collection drop and rename oplog entries
This applies only to the case where the target collection is dropped during the rename
operation.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/rollback_wt_drop.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/noPassthrough/rollback_wt_drop.js b/jstests/noPassthrough/rollback_wt_drop.js index e98708de58b..1d05e94b3f3 100644 --- a/jstests/noPassthrough/rollback_wt_drop.js +++ b/jstests/noPassthrough/rollback_wt_drop.js @@ -109,7 +109,10 @@ const ops = replTest.dumpOplog(rollbackNode, {ns: 'test.$cmd', 'o.drop': 't'}); assert.eq(1, ops.length); const op = ops[0]; - assert(!op.hasOwnProperty('o2'), 'unexpected o2 field in drop oplog entry: ' + tojson(op)); + assert(op.hasOwnProperty('o2'), 'expected o2 field in drop oplog entry: ' + tojson(op)); + assert(op.o2.hasOwnProperty('numRecords'), + 'expected count in drop oplog entry: ' + tojson(op)); + assert.eq(2, op.o2.numRecords, 'incorrect count in drop oplog entry: ' + tojson(op)); } // Check collection rename oplog entry. @@ -119,8 +122,10 @@ rollbackNode, {ns: 'test.$cmd', 'o.renameCollection': 'test.z', 'o.to': 'test.x'}); assert.eq(1, ops.length); const op = ops[0]; - assert(!op.hasOwnProperty('o2'), - 'unexpected o2 field in rename oplog entry: ' + tojson(op)); + assert(op.hasOwnProperty('o2'), 'expected o2 field in rename oplog entry: ' + tojson(op)); + assert(op.o2.hasOwnProperty('numRecords'), + 'expected count in rename oplog entry: ' + tojson(op)); + assert.eq(4, op.o2.numRecords, 'incorrect count in rename oplog entry: ' + tojson(op)); } // Wait for rollback to finish. |