From 607ff4cdc883e5c8cc56111d22fae633fde17f14 Mon Sep 17 00:00:00 2001 From: Vladimir Davydov <vdavydov@tarantool.org> Date: Tue, 8 Oct 2024 17:56:18 +0300 Subject: [PATCH] box: log error that caused initial checkpoint failure Currently, we just panic without providing any additional information if we failed to create the initial checkpoint on bootstrap. This complicates trouble shooting. Let's replace `panic()` with `say_error()` and raise the exception that caused the failure. The exception will be caught by `box_cfg()`, which will log it and then panic. NO_DOC=error logging NO_TEST=error logging NO_CHANGELOG=error logging (cherry picked from commit e1b5114d99ed2f224e9e9a17bf29882e50be3653) --- src/box/box.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index 008a0a1131..5edc4cb5c9 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -4572,8 +4572,10 @@ bootstrap_master(const struct tt_uuid *replicaset_uuid) diag_raise(); /* Make the initial checkpoint */ - if (gc_checkpoint() != 0) - panic("failed to create a checkpoint"); + if (gc_checkpoint() != 0) { + say_error("failed to create a checkpoint"); + diag_raise(); + } box_run_on_recovery_state(RECOVERY_STATE_SNAPSHOT_RECOVERED); box_run_on_recovery_state(RECOVERY_STATE_WAL_RECOVERED); @@ -4667,8 +4669,10 @@ bootstrap_from_master(struct replica *master) diag_raise(); /* Make the initial checkpoint */ - if (gc_checkpoint() != 0) - panic("failed to create a checkpoint"); + if (gc_checkpoint() != 0) { + say_error("failed to create a checkpoint"); + diag_raise(); + } box_run_on_recovery_state(RECOVERY_STATE_WAL_RECOVERED); -- GitLab