summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/idempotency_update_sequence.cpp
diff options
context:
space:
mode:
authormay <may.hoque@mongodb.com>2017-08-11 23:02:00 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2017-08-11 23:02:00 -0400
commit51dc6af5cc53805d8a523c45ae285da5fddc58f2 (patch)
treeac3a2de37dc614cdf50765924964ca4f6eb79c01 /src/mongo/db/repl/idempotency_update_sequence.cpp
parentbf3c4e9ab60879053b8bf65932c0bbe4b520ff84 (diff)
downloadmongo-51dc6af5cc53805d8a523c45ae285da5fddc58f2.tar.gz
SERVER-29944 Implement a basic idempotency checker for testing oplog
idempotency Signed-off-by: Max Hirschhorn <max.hirschhorn@mongodb.com> Also includes changes to tie the PseudoRandom instances in ScalarGenerator and UpdateSequenceGenerator together via a SecureRandom in runIdempotencyTestCase().
Diffstat (limited to 'src/mongo/db/repl/idempotency_update_sequence.cpp')
-rw-r--r--src/mongo/db/repl/idempotency_update_sequence.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/db/repl/idempotency_update_sequence.cpp b/src/mongo/db/repl/idempotency_update_sequence.cpp
index b902316ec76..24335b5b5f9 100644
--- a/src/mongo/db/repl/idempotency_update_sequence.cpp
+++ b/src/mongo/db/repl/idempotency_update_sequence.cpp
@@ -265,19 +265,14 @@ DocumentStructureEnumerator UpdateSequenceGenerator::_getValidEnumeratorForPath(
return enumerator;
}
-BSONObj UpdateSequenceGenerator::generate() const {
- return generateUpdate();
-}
-
std::vector<std::string> UpdateSequenceGenerator::getPaths() const {
return this->_paths;
}
UpdateSequenceGenerator::UpdateSequenceGenerator(UpdateSequenceGeneratorConfig config,
+ PseudoRandom random,
ScalarGenerator* scalarGenerator)
- : _config(std::move(config)),
- _random(std::unique_ptr<SecureRandom>(SecureRandom::create())->nextInt64()),
- _scalarGenerator(scalarGenerator) {
+ : _config(std::move(config)), _random(random), _scalarGenerator(scalarGenerator) {
auto path = "";
_generatePaths(config, path);
// Creates the same shuffle each time, but we don't care. We want to mess up the DFS ordering.