summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-06-14 15:09:07 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2019-06-14 15:10:25 -0400
commit9d0331eb17fddb3ae2215648363223cc0ae03a0f (patch)
treee4a5bce0397b838b6a9dc671d97d3ae9d72f6392
parentf9c9dd17f411e8db26d898a3b74bcc2fb07fd8eb (diff)
downloadmongo-9d0331eb17fddb3ae2215648363223cc0ae03a0f.tar.gz
SERVER-40336 Use SecureRandom to seed the random number generator in replication coordinator.
(cherry picked from commit c600aa9d7423eca8151daf626e2799d9a6c7b31c)
-rw-r--r--src/mongo/db/db.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index e05ed922183..fd1a3a02c8f 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -112,6 +112,7 @@
#include "mongo/db/wire_version.h"
#include "mongo/executor/network_interface_factory.h"
#include "mongo/platform/process_id.h"
+#include "mongo/platform/random.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
#include "mongo/s/sharding_initialization.h"
@@ -1019,7 +1020,7 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(CreateReplicationManager,
executor::makeNetworkInterface("NetworkInterfaceASIO-Replication").release(),
new repl::TopologyCoordinatorImpl(topoCoordOptions),
storageInterface,
- static_cast<int64_t>(curTimeMillis64()));
+ std::unique_ptr<SecureRandom>(SecureRandom::create())->nextInt64());
repl::ReplicationCoordinator::set(serviceContext, std::move(replCoord));
repl::setOplogCollectionName();
return Status::OK();