From 5df607f1e120729e598dc69239d3bce6d4ff60d0 Mon Sep 17 00:00:00 2001 From: Marko Budiselic Date: Sun, 8 May 2022 06:26:47 +0200 Subject: [PATCH] Add SYNC to UNABLE_TO_REPLICATE --- src/query/interpreter.cpp | 4 ++-- src/storage/v2/commit_error.hpp | 2 +- src/storage/v2/storage.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/interpreter.cpp b/src/query/interpreter.cpp index 0910ff1f1..89b73c00a 100644 --- a/src/query/interpreter.cpp +++ b/src/query/interpreter.cpp @@ -2210,7 +2210,7 @@ void RunTriggersIndividually(const utils::SkipList &triggers, Interpret if (maybe_commit_error.HasError()) { const auto &commit_error = maybe_commit_error.GetError(); switch (commit_error.type) { - case storage::CommitError::Type::UNABLE_TO_REPLICATE: { + case storage::CommitError::Type::UNABLE_TO_SYNC_REPLICATE: { // TODO(gitbuda): This is tricky because this is an internal // operation. Consider stopping main Memgraph instance here. spdlog::warn("Trigger '{}' failed to commit due to inability to replicate data to SYNC replica", @@ -2287,7 +2287,7 @@ void Interpreter::Commit() { if (maybe_commit_error.HasError()) { const auto &commit_error = maybe_commit_error.GetError(); switch (commit_error.type) { - case storage::CommitError::Type::UNABLE_TO_REPLICATE: { + case storage::CommitError::Type::UNABLE_TO_SYNC_REPLICATE: { reset_necessary_members(); throw QueryException("Unable to commit due to inability to replicate to SYNC replica"); break; diff --git a/src/storage/v2/commit_error.hpp b/src/storage/v2/commit_error.hpp index 995afc04f..29f014e50 100644 --- a/src/storage/v2/commit_error.hpp +++ b/src/storage/v2/commit_error.hpp @@ -20,7 +20,7 @@ namespace memgraph::storage { struct CommitError { enum class Type { CONSTRAINT_VIOLATION, - UNABLE_TO_REPLICATE, + UNABLE_TO_SYNC_REPLICATE, }; Type type; diff --git a/src/storage/v2/storage.cpp b/src/storage/v2/storage.cpp index 074c61e13..d04ff58e5 100644 --- a/src/storage/v2/storage.cpp +++ b/src/storage/v2/storage.cpp @@ -870,7 +870,7 @@ utils::BasicResult Storage::Accessor::Commit( check_replicas(); if (unable_to_sync_replicate) { Abort(); - return CommitError{.type = CommitError::Type::UNABLE_TO_REPLICATE}; + return CommitError{.type = CommitError::Type::UNABLE_TO_SYNC_REPLICATE}; } { @@ -952,7 +952,7 @@ utils::BasicResult Storage::Accessor::Commit( check_replicas(); if (unable_to_sync_replicate) { Abort(); - return CommitError{.type = CommitError::Type::UNABLE_TO_REPLICATE}; + return CommitError{.type = CommitError::Type::UNABLE_TO_SYNC_REPLICATE}; } if (unique_constraint_violation) {