Improve messages and comments

This commit is contained in:
Marko Budiselic 2022-05-01 04:17:54 +02:00
parent 28eef7edf4
commit e32adaa18c
2 changed files with 9 additions and 2 deletions

View File

@ -2211,7 +2211,10 @@ void RunTriggersIndividually(const utils::SkipList<Trigger> &triggers, Interpret
const auto &commit_error = maybe_commit_error.GetError();
switch (commit_error.type) {
case storage::CommitError::Type::UNABLE_TO_REPLICATE: {
spdlog::warn("Unable to replicate to SYNC replica on COMMIT");
// 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",
trigger.Name());
break;
}
case storage::CommitError::Type::CONSTRAINT_VIOLATION: {
@ -2286,7 +2289,7 @@ void Interpreter::Commit() {
switch (commit_error.type) {
case storage::CommitError::Type::UNABLE_TO_REPLICATE: {
reset_necessary_members();
throw QueryException("Unable to replicate to SYNC replica");
throw QueryException("Unable to commit due to inability to replicate to SYNC replica");
break;
}
case storage::CommitError::Type::CONSTRAINT_VIOLATION: {

View File

@ -1165,6 +1165,10 @@ EdgeTypeId Storage::NameToEdgeType(const std::string_view &name) {
// because there is no an abort op for that yet, one idea is to just apply
// reverse operation, e.g., CreateIndex <-> DropIndex.
//
// Another idea is to double check that all replicas have relevant data prior
// to calling MarkFinished. That approach would work in both data replication
// and global operation cases.
//
// EDGE CASE 1: What if the first SYNC replica is alive, receives the delta
// object, while the second SYNC replica is dead? (replication clients are
// stored in a vector and accessed one by one)