Loading include/config.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ namespace config { // writes to dev null instead of chunk space, read is reading /dev/zero constexpr bool limbo_mode = true; // ignores self host and will not send RPC to self. Single same node setups will no longer work. constexpr bool ignore_self = true; constexpr auto hostfile_path = "./gkfs_hosts.txt"; Loading src/client/preload_util.cpp +25 −3 Original line number Diff line number Diff line Loading @@ -197,10 +197,12 @@ void load_hosts() { auto local_hostname = gkfs::rpc::get_my_hostname(true); bool local_host_found = false; uint64_t local_host_id = 0; std::vector<hermes::endpoint> addrs; addrs.resize(hosts.size()); vector<uint64_t> host_ids(hosts.size()); // populate vector with [0, ..., host_size - 1] ::iota(::begin(host_ids), ::end(host_ids), 0); Loading @@ -215,11 +217,28 @@ void load_hosts() { ::shuffle(host_ids.begin(), host_ids.end(), g); // Shuffle hosts vector // lookup addresses and put abstract server addresses into rpc_addresses if (gkfs::config::ignore_self) { // preconditioner to be able to ignore localhost for (const auto& id: host_ids) { const auto& hostname = hosts.at(id).first; const auto& uri = hosts.at(id).second; if (hostname == local_hostname) { local_host_found = true; local_host_id = id; break; } } // put into if if (local_host_found) { addrs.resize(hosts.size() - 1); CTX->local_host_id(0); LOG(INFO, "Local host will be ignored with host size - 1."); } } addrs[id] = lookup_endpoint(uri); auto addr_cnt = 0; for (const auto& id: host_ids) { const auto& hostname = hosts.at(id).first; const auto& uri = hosts.at(id).second; if (!local_host_found && hostname == local_hostname) { LOG(DEBUG, "Found local host: {}", hostname); Loading @@ -227,7 +246,10 @@ void load_hosts() { local_host_found = true; } LOG(DEBUG, "Found peer: {}", addrs[id].to_string()); addrs[addr_cnt] = lookup_endpoint(uri); LOG(DEBUG, "Found peer: {}", addrs[addr_cnt].to_string()); addr_cnt++; } if (!local_host_found) { Loading src/daemon/backend/data/chunk_storage.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -97,8 +97,6 @@ ChunkStorage::ChunkStorage(string& path, const size_t chunksize) : log_->info("{}() Throttle enabled: have '{}' should '{}' in bytes", __func__, throttle_bw_have_, throttle_bw_should_); } log_->info("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); } Loading Loading
include/config.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ namespace config { // writes to dev null instead of chunk space, read is reading /dev/zero constexpr bool limbo_mode = true; // ignores self host and will not send RPC to self. Single same node setups will no longer work. constexpr bool ignore_self = true; constexpr auto hostfile_path = "./gkfs_hosts.txt"; Loading
src/client/preload_util.cpp +25 −3 Original line number Diff line number Diff line Loading @@ -197,10 +197,12 @@ void load_hosts() { auto local_hostname = gkfs::rpc::get_my_hostname(true); bool local_host_found = false; uint64_t local_host_id = 0; std::vector<hermes::endpoint> addrs; addrs.resize(hosts.size()); vector<uint64_t> host_ids(hosts.size()); // populate vector with [0, ..., host_size - 1] ::iota(::begin(host_ids), ::end(host_ids), 0); Loading @@ -215,11 +217,28 @@ void load_hosts() { ::shuffle(host_ids.begin(), host_ids.end(), g); // Shuffle hosts vector // lookup addresses and put abstract server addresses into rpc_addresses if (gkfs::config::ignore_self) { // preconditioner to be able to ignore localhost for (const auto& id: host_ids) { const auto& hostname = hosts.at(id).first; const auto& uri = hosts.at(id).second; if (hostname == local_hostname) { local_host_found = true; local_host_id = id; break; } } // put into if if (local_host_found) { addrs.resize(hosts.size() - 1); CTX->local_host_id(0); LOG(INFO, "Local host will be ignored with host size - 1."); } } addrs[id] = lookup_endpoint(uri); auto addr_cnt = 0; for (const auto& id: host_ids) { const auto& hostname = hosts.at(id).first; const auto& uri = hosts.at(id).second; if (!local_host_found && hostname == local_hostname) { LOG(DEBUG, "Found local host: {}", hostname); Loading @@ -227,7 +246,10 @@ void load_hosts() { local_host_found = true; } LOG(DEBUG, "Found peer: {}", addrs[id].to_string()); addrs[addr_cnt] = lookup_endpoint(uri); LOG(DEBUG, "Found peer: {}", addrs[addr_cnt].to_string()); addr_cnt++; } if (!local_host_found) { Loading
src/daemon/backend/data/chunk_storage.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -97,8 +97,6 @@ ChunkStorage::ChunkStorage(string& path, const size_t chunksize) : log_->info("{}() Throttle enabled: have '{}' should '{}' in bytes", __func__, throttle_bw_have_, throttle_bw_should_); } log_->info("{}() Chunk storage initialized with path: '{}'", __func__, root_path_); } Loading