Commit 7accb100 authored by David Auer's avatar David Auer
Browse files

Fix new daemons crashing due to unset distribution

parent 1ba243c0
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ read_hosts_file();
void
do_relocation(hostmap_t hosts);

void
reload_distribution_configuration();

} // namespace gkfs::relocation

#endif // GEKKOFS_CONFIG_MANAGER_HPP
 No newline at end of file
+18 −4
Original line number Diff line number Diff line
@@ -115,10 +115,15 @@ calculate_random_slicing() {
            dist->addDisks(&disks);
        }

        // Trigger all the hosts of the old configuration since they will need
        // to be sinding away their data.
        trigger_hosts = rs_hosts;
    } else {
        // Trigger all (!) the hosts:
        // - those of the old configuration as they need to send away their data
        // - the new hosts, because they need to reload the new rs configuration

        // Start with all the host of the new configuration
        trigger_hosts = rsdist.get_hosts_map();
        // add the "old" hosts, ignoring existing keys
        trigger_hosts.insert(rs_hosts.begin(), rs_hosts.end());
    } else { // no resconfig exists, create from scratch
        GKFS_DATA->spdlogger()->info(
                "{}() No existing random slicing configuration found, "
                "creating from scratch with {} hosts.",
@@ -216,4 +221,13 @@ do_relocation(hostmap_t hosts) {
    margo_finalize(mid);
}

void
reload_distribution_configuration() {
    auto dist_impl = make_shared<VDRIVE::DistRandSlice>();
    dist_impl->from_file(GKFS_DATA->hosts_file() + ".rsconfig");
    auto distributor =
            make_shared<gkfs::rpc::RandomSlicingDistributor>(dist_impl);
    GKFS_DATA->distributor(distributor);
}

} // namespace gkfs::relocation
 No newline at end of file
+2 −8
Original line number Diff line number Diff line
@@ -41,14 +41,8 @@ namespace gkfs::relocation {
int
transmit_metadata_and_data(gkfs::rpc::host_t localhost) {
    // TODO(dauer) return error code on error
    {
        // TODO(dauer) move this to somewhere appropriate
        auto dist_impl = make_shared<VDRIVE::DistRandSlice>();
        dist_impl->from_file(GKFS_DATA->hosts_file() + ".rsconfig");
        auto distributor =
                make_shared<gkfs::rpc::RandomSlicingDistributor>(dist_impl);
        GKFS_DATA->distributor(distributor);
    }

    reload_distribution_configuration();

    auto mid = RPC_DATA->client_rpc_mid();
    auto relocate_metadata_id =