Commit 7581a73c authored by Ramon Nou's avatar Ramon Nou
Browse files

Reject replicated topology mutation at daemons

parent 3bdd5f71
Loading
Loading
Loading
Loading
Loading
+2 −0
Changes for README.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1048,6 +1048,8 @@ Client-metrics require the CMake argument `-DGKFS_ENABLE_CLIENT_METRICS=ON` (see
- `LIBGKFS_NUM_REPL` - Number of replicas for data.
- Mutation/redistribution is rejected while `LIBGKFS_NUM_REPL` is nonzero until
  replica-aware placement and recovery are implemented.
- Daemons can mirror this safety setting with `GKFS_DAEMON_NUM_REPL`; any
  nonzero value rejects topology mutation before maintenance starts.
- The migration planner and recovery state track replica copy indices and
  placement generations, but the live daemon executor still rejects
  replica-tagged migration jobs until it has an explicit remote source-copy
+2 −0
Changes for docs/sphinx/users/running.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -370,6 +370,8 @@ set up for each client independently.

Mutation and redistribution are currently rejected while replication is enabled;
replica-aware placement during topology changes is not yet supported.
Set `GKFS_DAEMON_NUM_REPL` consistently on daemons to make the same rejection
explicit at the daemon boundary.
The internal planner tracks copy indices and placement generations, but live
replica migration remains disabled until daemon-side source-copy reads exist.

+7 −0
Changes for include/daemon/classes/fs_data.hpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ private:
    std::string bind_proxy_addr_{}; // optional when used with running proxy.
                                    // Remains empty if unused
    std::string hosts_file_{};
    int replica_count_{0};
    bool use_auto_sm_;

    // Database
@@ -333,6 +334,12 @@ public:
    void
    hosts_file(const std::string& lookup_file);

    int
    replica_count() const;

    void
    replica_count(int count);

    bool
    atime_state() const;

+1 −0
Changes for include/daemon/env.hpp: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ static constexpr auto DAEMON_CREATE_EXIST_CHECK =
        ADD_PREFIX("CREATE_EXIST_CHECK");
static constexpr auto KEEP_HOSTS_FILE = ADD_PREFIX("KEEP_HOSTS_FILE");
static constexpr auto DAEMON_EXPAND_MODE = ADD_PREFIX("EXPAND");
static constexpr auto DAEMON_NUM_REPL = ADD_PREFIX("NUM_REPL");
static constexpr auto ENABLE_WAL = ADD_PREFIX("ENABLE_WAL");
static constexpr auto ENABLE_STATS = ADD_PREFIX("ENABLE_STATS");
static constexpr auto ENABLE_CHUNKSTATS = ADD_PREFIX("ENABLE_CHUNKSTATS");
+10 −0
Changes for src/daemon/classes/fs_data.cpp: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -276,6 +276,16 @@ FsData::hosts_file(const std::string& lookup_file) {
    hosts_file_ = lookup_file;
}

int
FsData::replica_count() const {
    return replica_count_;
}

void
FsData::replica_count(const int count) {
    replica_count_ = count;
}

bool
FsData::use_auto_sm() const {
    return use_auto_sm_;
Loading