Verified Commit c0ee81e7 authored by Ramon Nou's avatar Ramon Nou Committed by Marc Vef
Browse files

Changelog change and branch

Added NUM_REPL env variable. (0 no replicas)

NUM_REPL  num replicas  (Replicas < servers)

Remove and truncate

Metadata replication

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 0916c555
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- 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
### Changed
+6 −0
Original line number Diff line number Diff line
@@ -320,6 +320,12 @@ Support for fstat in renamed files is included.

This is disabled by default.

### Replication
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

This software was partially supported by the EC H2020 funded NEXTGenIO project (Project ID: 671951, www.nextgenio.eu).
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static constexpr auto HOSTS_FILE = ADD_PREFIX("HOSTS_FILE");
#ifdef GKFS_ENABLE_FORWARDING
static constexpr auto FORWARDING_MAP_FILE = ADD_PREFIX("FORWARDING_MAP_FILE");
#endif

static constexpr auto NUM_REPL = ADD_PREFIX("NUM_REPL");
} // namespace gkfs::env

#undef ADD_PREFIX
+7 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ private:
    bool internal_fds_must_relocate_;
    std::bitset<MAX_USER_FDS> protected_fds_;
    std::string hostname;
    int replicas_;

public:
    static PreloadContext*
@@ -216,6 +217,12 @@ public:

    std::string
    get_hostname();

    void
    set_replicas(const int repl);

    int
    get_replicas();
};

} // namespace preload
+8 −3
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@
#ifndef GEKKOFS_CLIENT_FORWARD_DATA_HPP
#define GEKKOFS_CLIENT_FORWARD_DATA_HPP

#include <string>
#include <memory>
#include <set>
namespace gkfs::rpc {

struct ChunkStat {
@@ -43,14 +46,16 @@ struct ChunkStat {

std::pair<int, ssize_t>
forward_write(const std::string& path, const void* buf, off64_t offset,
              size_t write_size);
              size_t write_size, const int8_t num_copy = 0);

std::pair<int, ssize_t>
forward_read(const std::string& path, void* buf, off64_t offset,
             size_t read_size);
             size_t read_size, const int8_t num_copies,
             std::set<int8_t>& failed);

int
forward_truncate(const std::string& path, size_t current_size, size_t new_size);
forward_truncate(const std::string& path, size_t current_size, size_t new_size,
                 const int8_t num_copies);

std::pair<int, ChunkStat>
forward_get_chunk_stat();
Loading