summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-04-05 18:27:30 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2019-04-08 14:02:15 -0400
commitc600aa9d7423eca8151daf626e2799d9a6c7b31c (patch)
tree6baec4cb225a55cecf69223a8fcb9166a1188ca1 /src/mongo/db/db.cpp
parent73e719a1ee1c174a3131e19b537b3ae8aa958dad (diff)
downloadmongo-c600aa9d7423eca8151daf626e2799d9a6c7b31c.tar.gz
SERVER-40336 Use SecureRandom to seed the random number generator in replication coordinator.
Diffstat (limited to 'src/mongo/db/db.cpp')
-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 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<repl::TopologyCoordinator>(topoCoordOptions),
replicationProcess,
storageInterface,
- static_cast<int64_t>(curTimeMillis64()));
+ SecureRandom::create()->nextInt64());
repl::ReplicationCoordinator::set(serviceContext, std::move(replCoord));
repl::setOplogCollectionName(serviceContext);