Add SYNC to UNABLE_TO_REPLICATE

This commit is contained in:
Marko Budiselic 2022-05-08 06:26:47 +02:00
parent e32adaa18c
commit 5df607f1e1
3 changed files with 5 additions and 5 deletions

View File

@ -2210,7 +2210,7 @@ void RunTriggersIndividually(const utils::SkipList<Trigger> &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;

View File

@ -20,7 +20,7 @@ namespace memgraph::storage {
struct CommitError {
enum class Type {
CONSTRAINT_VIOLATION,
UNABLE_TO_REPLICATE,
UNABLE_TO_SYNC_REPLICATE,
};
Type type;

View File

@ -870,7 +870,7 @@ utils::BasicResult<CommitError, void> 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<CommitError, void> 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) {