Commit 2f238134 authored by Marc Vef's avatar Marc Vef
Browse files

Adding daemon MalleableManager base class

parent 08da8a31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ target_sources(
         classes/rpc_data.hpp
         handler/rpc_defs.hpp
         handler/rpc_util.hpp
    malleability/malleable_manager.hpp
)

if(GKFS_ENABLE_AGIOS)
+12 −2
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ namespace utils {
class Stats;
}

namespace malleable {
class MalleableManager;
}

namespace daemon {

class FsData {
@@ -106,15 +110,14 @@ private:
    // Prometheus
    std::string prometheus_gateway_ = gkfs::config::stats::prometheus_gateway;

    // Malleability
    // maintenance mode is used to prevent new RPCs to the filesystem and
    // indicates for clients: try again. Is set to true when redist is running
    bool maintenance_mode_ = false;
    ABT_mutex maintenance_mode_mutex_;
    // redist_running_ indicates to client that redistribution is running
    bool redist_running_ = false;
    ABT_thread redist_thread_;

    std::shared_ptr<gkfs::malleable::MalleableManager> malleable_manager_;

public:
    static FsData*
@@ -308,6 +311,13 @@ public:

    void
    redist_running(bool redist_running);

    const std::shared_ptr<gkfs::malleable::MalleableManager>&
    malleable_manager() const;

    void
    malleable_manager(const std::shared_ptr<gkfs::malleable::MalleableManager>&
                              malleable_manager);
};


+55 −0
Original line number Diff line number Diff line
/*
  Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain
  Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany

  This software was partially supported by the
  EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).

  This software was partially supported by the
  ADA-FS project under the SPPEXA project funded by the DFG.

  This file is part of GekkoFS.

  GekkoFS is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  GekkoFS is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.

  SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef GEKKOFS_DAEMON_MALLEABLE_MANAGER_HPP
#define GEKKOFS_DAEMON_MALLEABLE_MANAGER_HPP

#include <daemon/daemon.hpp>

namespace gkfs::malleable {

class MalleableManager {
private:
    ABT_thread redist_thread_;

    static void
    expand_abt(void* _arg);

    void
    redistribute_metadata();

    void
    redistribute_data();

public:
    void
    expand_start(int old_server_conf, int new_server_conf);
};
} // namespace gkfs::malleable


#endif // GEKKOFS_MALLEABLE_MANAGER_HPP
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ target_sources(
          handler/srv_metadata.cpp
          handler/srv_management.cpp
    handler/srv_malleability.cpp
    malleability/malleable_manager.cpp
  PUBLIC ${CMAKE_SOURCE_DIR}/include/config.hpp
         ${CMAKE_SOURCE_DIR}/include/version.hpp.in
)
+12 −0
Original line number Diff line number Diff line
@@ -350,4 +350,16 @@ FsData::redist_running(bool redist_running) {
    redist_running_ = redist_running;
}

const std::shared_ptr<gkfs::malleable::MalleableManager>&
FsData::malleable_manager() const {
    return malleable_manager_;
}

void
FsData::malleable_manager(
        const std::shared_ptr<gkfs::malleable::MalleableManager>&
                malleable_manager) {
    malleable_manager_ = malleable_manager;
}

} // namespace gkfs::daemon
Loading