summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@mongodb.com>2020-08-25 15:05:40 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-27 20:32:17 +0000
commit4406491b2b137984c2583db98068b7d18ea32171 (patch)
tree4632ca36ba021051e2e7cd4f301bcab45a4a1b03 /src/mongo/db/repl/oplog_batcher_test_fixture.cpp
parent470d9b90bb51d76094255022eeaa9fdbd4bcac76 (diff)
downloadmongo-4406491b2b137984c2583db98068b7d18ea32171.tar.gz
SERVER-49401 Extend OplogBufferCollection to support random access
Diffstat (limited to 'src/mongo/db/repl/oplog_batcher_test_fixture.cpp')
-rw-r--r--src/mongo/db/repl/oplog_batcher_test_fixture.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/repl/oplog_batcher_test_fixture.cpp b/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
index fcc08cec359..b8b9a8ea88f 100644
--- a/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
+++ b/src/mongo/db/repl/oplog_batcher_test_fixture.cpp
@@ -147,7 +147,9 @@ StatusWith<OplogBufferMock::Value> OplogBufferMock::findByTimestamp(OperationCon
str::stream() << "No such timestamp in collection: " << ts.toString()};
}
-Status OplogBufferMock::seekToTimestamp(OperationContext* opCtx, const Timestamp& ts, bool exact) {
+Status OplogBufferMock::seekToTimestamp(OperationContext* opCtx,
+ const Timestamp& ts,
+ SeekStrategy exact) {
stdx::unique_lock<Latch> lk(_mutex);
for (std::size_t i = 0; i < _data.size(); i++) {
if (_data[i]["ts"].timestamp() == ts) {
@@ -158,7 +160,7 @@ Status OplogBufferMock::seekToTimestamp(OperationContext* opCtx, const Timestamp
break;
}
}
- if (!exact)
+ if (exact != SeekStrategy::kExact)
return Status::OK();
return {ErrorCodes::KeyNotFound, str::stream() << "Timestamp not found: " << ts.toString()};
}