Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(slog): add an option to exit the process when find slog error #1574

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/replica/replica_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ DSN_DEFINE_bool(replication,
verbose_commit_log_on_start,
false,
"whether to print verbose log when commit mutation when starting the server");
DSN_DEFINE_bool(
replication,
crash_on_slog_error,
false,
"whether to exit the process while fail to open slog. If true, the process will exit and leave "
"the corrupted slog and replicas to be handled by the administrator. If false, the process "
"will continue, and remove the slog and move all the replicas to corresponding error "
"directories");
DSN_DEFINE_uint32(replication,
max_concurrent_manual_emergency_checkpointing_count,
10,
Expand Down Expand Up @@ -708,6 +716,9 @@ void replica_stub::initialize(const replication_options &opts, bool clear /* = f
if (err == ERR_OK) {
LOG_INFO("replay shared log succeed, time_used = {} ms", finish_time - start_time);
} else {
if (FLAGS_crash_on_slog_error) {
LOG_FATAL("replay shared log failed, err = {}, please check the error details", err);
}
LOG_ERROR("replay shared log failed, err = {}, time_used = {} ms, clear all logs ...",
err,
finish_time - start_time);
Expand Down