Commit f0177ac9 authored by Ramon Nou's avatar Ramon Nou Committed by Ramon Nou
Browse files

Changelog change and branch

WIP - REPL

Added NUM_REPL env variable. (0 no replicas)

NUM_REPL  num replicas  (Replicas < servers)

Remove and truncate

Metadata replication - WIP

Metadata replication - Reattempt on stat

minimal compilation issues (c++20), srand for repl

Bitset

Bit set proposal (WIP)

Read - Write with bitset (<1024 chunks)

Changed bitset to vector

Added get_fs_config reattempt

Some more resilience on create

Added Replica_Check on write (disabled)

Added helper vector-bitset functions
parent e83e86d2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@ replicas ([!166](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/141)
  fixed([!176](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_request/176)).

## [0.9.2] - 2024-02
- Replication without using the server. NUM_REPL (0 < NUM_REPL < num_servers) env variable defines the number of 
replicas ([!166](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/141)).
- Modified write and reads to use a bitset instead of the traditional hash per chunk in the server.
- Added reattemp support in get_fs_config to other servers, when the initial server fails.

### New

+4 −0
Original line number Diff line number Diff line
@@ -371,6 +371,10 @@ start_t_micro: [5755,9553,14132,16841]
total_bytes: 1802366
total_iops: 4
```
The user can enable the data replication feature by setting the replication environment variable:
`LIBGKFS_NUM_REPL=<num repl>`.
The number of replicas should go from 0 to the number of servers-1. 
The replication environment variable can be set up for each client, independently.

## Acknowledgment

+1 −2
Original line number Diff line number Diff line
@@ -109,11 +109,9 @@ private:
    std::bitset<MAX_USER_FDS> protected_fds_;
    std::string hostname;
    int replicas_;

    std::shared_ptr<gkfs::messagepack::ClientMetrics> write_metrics_;
    std::shared_ptr<gkfs::messagepack::ClientMetrics> read_metrics_;


public:
    static PreloadContext*
    getInstance() {
@@ -241,6 +239,7 @@ public:

    const std::shared_ptr<gkfs::messagepack::ClientMetrics>
    read_metrics();

};

} // namespace preload
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ compress_bitset(const std::vector<uint8_t>& bytes);
std::vector<uint8_t>
decompress_bitset(const std::string& compressedString);


} // namespace gkfs::rpc

#endif // GEKKOFS_COMMON_RPC_UTILS_HPP
+10 −1
Original line number Diff line number Diff line
@@ -882,8 +882,10 @@ gkfs_do_write(gkfs::filemap::OpenFile& file, const char* buf, size_t count,
        errno = EISDIR;
        return -1;
    }

    auto path = make_unique<string>(file.path());
    auto is_append = file.get_flag(gkfs::filemap::OpenFile_flags::append);

    auto write_size = 0;
    auto num_replicas = CTX->get_replicas();

@@ -1089,17 +1091,24 @@ gkfs_do_read(const gkfs::filemap::OpenFile& file, char* buf, size_t count,
    std::set<int8_t> failed; // set with failed targets.
    if(CTX->get_replicas() != 0) {

<<<<<<< HEAD
        ret = gkfs::rpc::forward_read(file.path(), buf, offset, count,
                                      CTX->get_replicas(), failed);
        while(ret.first == EIO) {
            ret = gkfs::rpc::forward_read(file.path(), buf, offset, count,
=======
        ret = gkfs::rpc::forward_read(file->path(), buf, offset, count,
                                      CTX->get_replicas(), failed);
        while(ret.first == EIO) {
            ret = gkfs::rpc::forward_read(file->path(), buf, offset, count,
>>>>>>> 9ff73051 (Changelog change and branch)
                                          CTX->get_replicas(), failed);
            LOG(WARNING, "gkfs::rpc::forward_read() failed with ret '{}'",
                ret.first);
        }

    } else {
        ret = gkfs::rpc::forward_read(file.path(), buf, offset, count, 0,
        ret = gkfs::rpc::forward_read(file->path(), buf, offset, count, 0,
                                      failed);
    }

Loading