From c600aa9d7423eca8151daf626e2799d9a6c7b31c Mon Sep 17 00:00:00 2001 From: Siyuan Zhou Date: Fri, 5 Apr 2019 18:27:30 -0400 Subject: SERVER-40336 Use SecureRandom to seed the random number generator in replication coordinator. --- src/mongo/db/db.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mongo/db') diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 5df53cc0ef3..a11a241ab35 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -140,6 +140,7 @@ #include "mongo/executor/network_interface_thread_pool.h" #include "mongo/executor/thread_pool_task_executor.h" #include "mongo/platform/process_id.h" +#include "mongo/platform/random.h" #include "mongo/rpc/metadata/egress_metadata_hook_list.h" #include "mongo/s/client/shard_registry.h" #include "mongo/s/grid.h" @@ -834,7 +835,7 @@ void setUpReplication(ServiceContext* serviceContext) { stdx::make_unique(topoCoordOptions), replicationProcess, storageInterface, - static_cast(curTimeMillis64())); + SecureRandom::create()->nextInt64()); repl::ReplicationCoordinator::set(serviceContext, std::move(replCoord)); repl::setOplogCollectionName(serviceContext); -- cgit v1.2.1