[Tarantool-patches] [PATCH 01/13] error: introduce ER_CASCADE_ROLLBACK
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sat Jun 12 00:56:05 MSK 2021
It was called ER_CHECKPOINT_ROLLBACK but was set only when there
is a cascade rollback in WAL.
The new error name is going to be used in the next patches, where
not only checkpoint can fail due to a cascade rollback.
Part of #6027
---
src/box/errcode.h | 2 +-
src/box/wal.c | 8 ++++----
test/box/errinj.result | 2 +-
test/box/error.result | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/box/errcode.h b/src/box/errcode.h
index d93820e96..b143e91d9 100644
--- a/src/box/errcode.h
+++ b/src/box/errcode.h
@@ -186,7 +186,7 @@ struct errcode_record {
/*131 */_(ER_INVALID_INDEX_FILE, "Invalid INDEX file %s: %s") \
/*132 */_(ER_INVALID_RUN_FILE, "Invalid RUN file: %s") \
/*133 */_(ER_INVALID_VYLOG_FILE, "Invalid VYLOG file: %s") \
- /*134 */_(ER_CHECKPOINT_ROLLBACK, "Can't start a checkpoint while in cascading rollback") \
+ /*134 */_(ER_CASCADE_ROLLBACK, "WAL has a rollback in progress") \
/*135 */_(ER_VY_QUOTA_TIMEOUT, "Timed out waiting for Vinyl memory quota") \
/*136 */_(ER_PARTIAL_KEY, "%s index does not support selects via a partial key (expected %u parts, got %u). Please Consider changing index type to TREE.") \
/*137 */_(ER_TRUNCATE_SYSTEM_SPACE, "Can't truncate a system space, space '%s'") \
diff --git a/src/box/wal.c b/src/box/wal.c
index 63ff5584a..5c52142ef 100644
--- a/src/box/wal.c
+++ b/src/box/wal.c
@@ -606,7 +606,7 @@ wal_sync_f(struct cbus_call_msg *data)
struct wal_writer *writer = &wal_writer_singleton;
if (writer->is_in_rollback) {
/* We're rolling back a failed write. */
- diag_set(ClientError, ER_WAL_IO);
+ diag_set(ClientError, ER_CASCADE_ROLLBACK);
return -1;
}
vclock_copy(&msg->vclock, &writer->vclock);
@@ -629,7 +629,7 @@ wal_sync(struct vclock *vclock)
}
if (!stailq_empty(&writer->rollback)) {
/* We're rolling back a failed write. */
- diag_set(ClientError, ER_WAL_IO);
+ diag_set(ClientError, ER_CASCADE_ROLLBACK);
return -1;
}
bool cancellable = fiber_set_cancellable(false);
@@ -653,7 +653,7 @@ wal_begin_checkpoint_f(struct cbus_call_msg *data)
* can't make a checkpoint - see the comment
* in wal_begin_checkpoint() for the explanation.
*/
- diag_set(ClientError, ER_CHECKPOINT_ROLLBACK);
+ diag_set(ClientError, ER_CASCADE_ROLLBACK);
return -1;
}
/*
@@ -691,7 +691,7 @@ wal_begin_checkpoint(struct wal_checkpoint *checkpoint)
* the snapshot. So we abort checkpointing in this
* case.
*/
- diag_set(ClientError, ER_CHECKPOINT_ROLLBACK);
+ diag_set(ClientError, ER_CASCADE_ROLLBACK);
return -1;
}
bool cancellable = fiber_set_cancellable(false);
diff --git a/test/box/errinj.result b/test/box/errinj.result
index 44ecafc40..43daf5f0f 100644
--- a/test/box/errinj.result
+++ b/test/box/errinj.result
@@ -898,7 +898,7 @@ box.schema.user.revoke('guest', 'read', 'space', '_space')
...
run()
---
-- error: Can't start a checkpoint while in cascading rollback
+- error: WAL has a rollback in progress
...
ch:get()
---
diff --git a/test/box/error.result b/test/box/error.result
index cc8cbaaa9..6ef099153 100644
--- a/test/box/error.result
+++ b/test/box/error.result
@@ -353,7 +353,7 @@ t;
| 131: box.error.INVALID_INDEX_FILE
| 132: box.error.INVALID_RUN_FILE
| 133: box.error.INVALID_VYLOG_FILE
- | 134: box.error.CHECKPOINT_ROLLBACK
+ | 134: box.error.CASCADE_ROLLBACK
| 135: box.error.VY_QUOTA_TIMEOUT
| 136: box.error.PARTIAL_KEY
| 137: box.error.TRUNCATE_SYSTEM_SPACE
--
2.24.3 (Apple Git-128)
More information about the Tarantool-patches
mailing list