diff options
author | may <may.hoque@mongodb.com> | 2017-08-11 23:02:00 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2017-08-11 23:02:00 -0400 |
commit | 51dc6af5cc53805d8a523c45ae285da5fddc58f2 (patch) | |
tree | ac3a2de37dc614cdf50765924964ca4f6eb79c01 /src/mongo/db/repl/idempotency_update_sequence.cpp | |
parent | bf3c4e9ab60879053b8bf65932c0bbe4b520ff84 (diff) | |
download | mongo-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.cpp | 9 |
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. |