Merge branch 'master' into text-search-integration-poc
This commit is contained in:
commit
5f2de50d28
34
ADRs/002_nuraft.md
Normal file
34
ADRs/002_nuraft.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# NuRaft ADR
|
||||||
|
|
||||||
|
**Author**
|
||||||
|
Marko Budiselic (github.com/gitbuda)
|
||||||
|
|
||||||
|
**Status**
|
||||||
|
PROPOSED
|
||||||
|
|
||||||
|
**Date**
|
||||||
|
January 10, 2024
|
||||||
|
|
||||||
|
**Problem**
|
||||||
|
|
||||||
|
In order to enhance Memgraph to have High Availability features as requested by
|
||||||
|
customers, we want to have reliable coordinators backed by RAFT consensus algorithm. Implementing
|
||||||
|
RAFT to be correct and performant is a very challenging task. Skillful Memgraph
|
||||||
|
engineers already tried 3 times and failed to deliver in a reasonable timeframe
|
||||||
|
all three times (approximately 4 person-weeks of engineering work each time).
|
||||||
|
|
||||||
|
**Criteria**
|
||||||
|
|
||||||
|
- easy integration with our C++ codebase
|
||||||
|
- heavily tested in production environments
|
||||||
|
- implementation of performance optimizations on top of the canonical Raft
|
||||||
|
implementation
|
||||||
|
|
||||||
|
**Decision**
|
||||||
|
|
||||||
|
There are a few, robust C++ implementations of Raft but as a part of other
|
||||||
|
projects or bigger libraries. **We select
|
||||||
|
[NuRaft](https://github.com/eBay/NuRaft)** because it focuses on delivering
|
||||||
|
Raft without bloatware, and it's used by
|
||||||
|
[Clickhouse](https://github.com/ClickHouse/ClickHouse) (an comparable peer to
|
||||||
|
Memgraph, a very well-established product).
|
@ -36,7 +36,7 @@ ADDITIONAL USE GRANT: You may use the Licensed Work in accordance with the
|
|||||||
3. using the Licensed Work to create a work or solution
|
3. using the Licensed Work to create a work or solution
|
||||||
which competes (or might reasonably be expected to
|
which competes (or might reasonably be expected to
|
||||||
compete) with the Licensed Work.
|
compete) with the Licensed Work.
|
||||||
CHANGE DATE: 2027-08-12
|
CHANGE DATE: 2028-21-01
|
||||||
CHANGE LICENSE: Apache License, Version 2.0
|
CHANGE LICENSE: Apache License, Version 2.0
|
||||||
|
|
||||||
For information about alternative licensing arrangements, please visit: https://memgraph.com/legal.
|
For information about alternative licensing arrangements, please visit: https://memgraph.com/legal.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2022 Memgraph Ltd.
|
// Copyright 2024 Memgraph Ltd.
|
||||||
//
|
//
|
||||||
// Use of this software is governed by the Business Source License
|
// Use of this software is governed by the Business Source License
|
||||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
@ -92,7 +92,7 @@ void RegisterLicenseSettings(LicenseChecker &license_checker, utils::Settings &s
|
|||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
LicenseChecker global_license_checker;
|
LicenseChecker global_license_checker;
|
||||||
|
|
||||||
LicenseChecker::~LicenseChecker() { scheduler_.Stop(); }
|
LicenseChecker::~LicenseChecker() { Finalize(); }
|
||||||
|
|
||||||
std::pair<std::string, std::string> LicenseChecker::ExtractLicenseInfo(const utils::Settings &settings) const {
|
std::pair<std::string, std::string> LicenseChecker::ExtractLicenseInfo(const utils::Settings &settings) const {
|
||||||
if (license_info_override_) {
|
if (license_info_override_) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2022 Memgraph Ltd.
|
// Copyright 2024 Memgraph Ltd.
|
||||||
//
|
//
|
||||||
// Use of this software is governed by the Business Source License
|
// Use of this software is governed by the Business Source License
|
||||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
@ -89,6 +89,8 @@ struct LicenseChecker {
|
|||||||
|
|
||||||
utils::Synchronized<std::optional<LicenseInfo>, utils::SpinLock> &GetLicenseInfo();
|
utils::Synchronized<std::optional<LicenseInfo>, utils::SpinLock> &GetLicenseInfo();
|
||||||
|
|
||||||
|
void Finalize() { scheduler_.Stop(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::pair<std::string, std::string> ExtractLicenseInfo(const utils::Settings &settings) const;
|
std::pair<std::string, std::string> ExtractLicenseInfo(const utils::Settings &settings) const;
|
||||||
void RevalidateLicense(const utils::Settings &settings);
|
void RevalidateLicense(const utils::Settings &settings);
|
||||||
|
@ -257,6 +257,8 @@ int main(int argc, char **argv) {
|
|||||||
// register all runtime settings
|
// register all runtime settings
|
||||||
memgraph::license::RegisterLicenseSettings(memgraph::license::global_license_checker,
|
memgraph::license::RegisterLicenseSettings(memgraph::license::global_license_checker,
|
||||||
memgraph::utils::global_settings);
|
memgraph::utils::global_settings);
|
||||||
|
memgraph::utils::OnScopeExit global_license_finalizer([] { memgraph::license::global_license_checker.Finalize(); });
|
||||||
|
|
||||||
memgraph::flags::run_time::Initialize();
|
memgraph::flags::run_time::Initialize();
|
||||||
|
|
||||||
memgraph::license::global_license_checker.CheckEnvLicense();
|
memgraph::license::global_license_checker.CheckEnvLicense();
|
||||||
@ -546,6 +548,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
memgraph::query::procedure::gModuleRegistry.UnloadAllModules();
|
memgraph::query::procedure::gModuleRegistry.UnloadAllModules();
|
||||||
|
|
||||||
|
python_gc_scheduler.Stop();
|
||||||
Py_END_ALLOW_THREADS;
|
Py_END_ALLOW_THREADS;
|
||||||
// Shutdown Python
|
// Shutdown Python
|
||||||
Py_Finalize();
|
Py_Finalize();
|
||||||
|
Loading…
Reference in New Issue
Block a user