diff --git a/src/mongo/db/modules/eloq/src/eloq_global_options.cpp b/src/mongo/db/modules/eloq/src/eloq_global_options.cpp index 9819d8a045..e38de53790 100644 --- a/src/mongo/db/modules/eloq/src/eloq_global_options.cpp +++ b/src/mongo/db/modules/eloq/src/eloq_global_options.cpp @@ -704,7 +704,11 @@ Status EloqGlobalOptions::store(const moe::Environment& params, } eloqGlobalOptions.hostManagerAddr = mongo::HostAndPort(hmIP, hmPort); + } else { + eloqGlobalOptions.hostManagerAddr = mongo::HostAndPort("", 0); } + + if (params.count("storage.eloq.txService.hmBinPath")) { auto hmBinPath = params["storage.eloq.txService.hmBinPath"].as(); if (hmBinPath.empty()) { diff --git a/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp b/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp index 08e3282aa6..16492d87c3 100644 --- a/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp +++ b/src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp @@ -311,14 +311,24 @@ EloqKVEngine::EloqKVEngine(const std::string& path) : _dbPath(path) { {"kickout_data_for_test", eloqGlobalOptions.kickoutDataForTest}, }; - const std::string& hmIP = eloqGlobalOptions.hostManagerAddr.host(); + std::string hmIP = eloqGlobalOptions.hostManagerAddr.host(); uint16_t hmPort = eloqGlobalOptions.hostManagerAddr.port(); - const std::string& hmBinPath = eloqGlobalOptions.hostManagerBinPath; + + std::string hmBinPath = eloqGlobalOptions.hostManagerBinPath; + #ifdef FORK_HM_PROCESS // If the Eloqdoc is under bootstrap mode, we will not fork host manager. // Otherwise, we will fork host manager if the option is enabled. // Currently, when deploying on the cloud we do not fork host manager. bool forkHostManager = !bootstrap && eloqGlobalOptions.forkHostManager; + if (forkHostManager && hmIP.empty()) { + hmIP = eloqGlobalOptions.localAddr.host(); + } + + if (forkHostManager && hmPort == 0) { + hmPort = eloqGlobalOptions.localAddr.port() + 4; + } + #else bool forkHostManager = false; #endif @@ -550,9 +560,9 @@ EloqKVEngine::EloqKVEngine(const std::string& path) : _dbPath(path) { clusterConfigVersion, &txlogIPs, &txlogPorts, - forkHostManager ? nullptr : &hmIP, - forkHostManager ? nullptr : &hmPort, - forkHostManager ? nullptr : &hmBinPath, + &hmIP, + &hmPort, + &hmBinPath, txServiceConf, std::move(_logAgent), localPath, diff --git a/src/mongo/db/modules/eloq/tx_service b/src/mongo/db/modules/eloq/tx_service index 123d7f7ab1..f4a1afbdfa 160000 --- a/src/mongo/db/modules/eloq/tx_service +++ b/src/mongo/db/modules/eloq/tx_service @@ -1 +1 @@ -Subproject commit 123d7f7ab1af0d19e341ba590d9163994ab20838 +Subproject commit f4a1afbdfa533db50abeb5ce0c67981510c6a8e6