Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mongo/db/modules/eloq/src/eloq_global_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>();
if (hmBinPath.empty()) {
Expand Down
20 changes: 15 additions & 5 deletions src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/modules/eloq/tx_service