summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2020-04-08 10:22:57 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-08 17:29:25 +0000
commit1700c42daa8b88c17ca49814b7752b9a1b14d3db (patch)
treeb848e1f63d5003ba0ba41cf16273f7d1483d0583 /src/mongo
parent8c7d32e37a2c82d08bfe7fb7cd755ac0022a53a8 (diff)
downloadmongo-1700c42daa8b88c17ca49814b7752b9a1b14d3db.tar.gz
SERVER-47071: Fix CheckReplOplogs hook
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/replsettest.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index ad46d9e1f61..a69b24b03b8 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -2470,13 +2470,13 @@ var ReplSetTest = function(opts) {
};
this.next = function() {
- this._safelyPerformCursorOperation('next', function(cursor) {
+ return this._safelyPerformCursorOperation('next', function(cursor) {
return cursor.next();
}, kCappedPositionLostSentinel);
};
this.hasNext = function() {
- this._safelyPerformCursorOperation('hasNext', function(cursor) {
+ return this._safelyPerformCursorOperation('hasNext', function(cursor) {
return cursor.hasNext();
}, false);
};
@@ -2563,6 +2563,7 @@ var ReplSetTest = function(opts) {
// Note, we read the oplog backwards from last to first.
const firstReader = readers[firstReaderIndex];
let prevOplogEntry;
+ assert(firstReader.hasNext(), "oplog is empty while checkOplogs is called");
while (firstReader.hasNext()) {
const oplogEntry = firstReader.next();
if (oplogEntry === kCappedPositionLostSentinel) {