[CP] split clog io error into disk full and disk hang.

This commit is contained in:
felix-w15
2023-10-31 19:39:21 +00:00
committed by ob-robot
parent 82c923e115
commit 7deebd40a1
7 changed files with 32 additions and 4 deletions

View File

@ -9,7 +9,6 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PubL v2 for more details. * See the Mulan PubL v2 for more details.
*/ */
// Copyright (c) 2018 Alibaba Inc. All Rights Reserved. // Copyright (c) 2018 Alibaba Inc. All Rights Reserved.
// //
/// \file errno.h /// \file errno.h

View File

@ -318,6 +318,16 @@ bool ObFailureDetector::is_clog_disk_has_fatal_error()
|| ATOMIC_LOAD(&has_add_clog_full_event_); || ATOMIC_LOAD(&has_add_clog_full_event_);
} }
bool ObFailureDetector::is_clog_disk_has_hang_error()
{
return ATOMIC_LOAD(&has_add_clog_hang_event_);
}
bool ObFailureDetector::is_clog_disk_has_full_error()
{
return ATOMIC_LOAD(&has_add_clog_full_event_);
}
bool ObFailureDetector::is_data_disk_has_fatal_error() bool ObFailureDetector::is_data_disk_has_fatal_error()
{ {
return ATOMIC_LOAD(&has_add_data_disk_hang_event_); return ATOMIC_LOAD(&has_add_data_disk_hang_event_);

View File

@ -92,6 +92,8 @@ public:
*/ */
void detect_failure(); void detect_failure();
bool is_clog_disk_has_fatal_error(); bool is_clog_disk_has_fatal_error();
bool is_clog_disk_has_hang_error();
bool is_clog_disk_has_full_error();
bool is_data_disk_has_fatal_error(); bool is_data_disk_has_fatal_error();
bool is_schema_not_refreshed(); bool is_schema_not_refreshed();
bool is_data_disk_full() const bool is_data_disk_full() const

File diff suppressed because one or more lines are too long

View File

@ -1770,6 +1770,7 @@ DEFINE_ERROR(OB_INVALID_BATCH_SIZE, -6321, -1, "HY000", "ob invalid batch size")
DEFINE_ERROR(OB_CLOG_SLIDE_TIMEOUT, -6322, -1, "HY000", "ob clog slide timeout"); DEFINE_ERROR(OB_CLOG_SLIDE_TIMEOUT, -6322, -1, "HY000", "ob clog slide timeout");
DEFINE_ERROR(OB_LOG_REPLAY_ERROR, -6323, -1, "HY000", "log replay error"); DEFINE_ERROR(OB_LOG_REPLAY_ERROR, -6323, -1, "HY000", "log replay error");
DEFINE_ERROR(OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT, -6324, -1, "HY000", "ob trying to lock config change conflicts"); DEFINE_ERROR(OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT, -6324, -1, "HY000", "ob trying to lock config change conflicts");
DEFINE_ERROR(OB_CLOG_DISK_HANG, -6325, -1, "HY000", "ob clog disk hang");
// for freeze // for freeze
// DEFINE_ERROR(OB_TABLET_FREEZE_TIMEOUT, -6400, -1, "HY000", "tablet_freeze timeout"); // DEFINE_ERROR(OB_TABLET_FREEZE_TIMEOUT, -6400, -1, "HY000", "tablet_freeze timeout");

View File

@ -1375,6 +1375,7 @@ constexpr int OB_INVALID_BATCH_SIZE = -6321;
constexpr int OB_CLOG_SLIDE_TIMEOUT = -6322; constexpr int OB_CLOG_SLIDE_TIMEOUT = -6322;
constexpr int OB_LOG_REPLAY_ERROR = -6323; constexpr int OB_LOG_REPLAY_ERROR = -6323;
constexpr int OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT = -6324; constexpr int OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT = -6324;
constexpr int OB_CLOG_DISK_HANG = -6325;
constexpr int OB_ELECTION_WARN_LOGBUF_FULL = -7000; constexpr int OB_ELECTION_WARN_LOGBUF_FULL = -7000;
constexpr int OB_ELECTION_WARN_LOGBUF_EMPTY = -7001; constexpr int OB_ELECTION_WARN_LOGBUF_EMPTY = -7001;
constexpr int OB_ELECTION_WARN_NOT_RUNNING = -7002; constexpr int OB_ELECTION_WARN_NOT_RUNNING = -7002;
@ -3400,6 +3401,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_CLOG_SLIDE_TIMEOUT__USER_ERROR_MSG "ob clog slide timeout" #define OB_CLOG_SLIDE_TIMEOUT__USER_ERROR_MSG "ob clog slide timeout"
#define OB_LOG_REPLAY_ERROR__USER_ERROR_MSG "log replay error" #define OB_LOG_REPLAY_ERROR__USER_ERROR_MSG "log replay error"
#define OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT__USER_ERROR_MSG "ob trying to lock config change conflicts" #define OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT__USER_ERROR_MSG "ob trying to lock config change conflicts"
#define OB_CLOG_DISK_HANG__USER_ERROR_MSG "ob clog disk hang"
#define OB_ELECTION_WARN_LOGBUF_FULL__USER_ERROR_MSG "The log buffer is full" #define OB_ELECTION_WARN_LOGBUF_FULL__USER_ERROR_MSG "The log buffer is full"
#define OB_ELECTION_WARN_LOGBUF_EMPTY__USER_ERROR_MSG "The log buffer is empty" #define OB_ELECTION_WARN_LOGBUF_EMPTY__USER_ERROR_MSG "The log buffer is empty"
#define OB_ELECTION_WARN_NOT_RUNNING__USER_ERROR_MSG "The object is not running" #define OB_ELECTION_WARN_NOT_RUNNING__USER_ERROR_MSG "The object is not running"
@ -5536,6 +5538,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_CLOG_SLIDE_TIMEOUT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6322, ob clog slide timeout" #define OB_CLOG_SLIDE_TIMEOUT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6322, ob clog slide timeout"
#define OB_LOG_REPLAY_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6323, log replay error" #define OB_LOG_REPLAY_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6323, log replay error"
#define OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6324, ob trying to lock config change conflicts" #define OB_TRY_LOCK_CONFIG_CHANGE_CONFLICT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6324, ob trying to lock config change conflicts"
#define OB_CLOG_DISK_HANG__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -6325, ob clog disk hang"
#define OB_ELECTION_WARN_LOGBUF_FULL__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7000, The log buffer is full" #define OB_ELECTION_WARN_LOGBUF_FULL__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7000, The log buffer is full"
#define OB_ELECTION_WARN_LOGBUF_EMPTY__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7001, The log buffer is empty" #define OB_ELECTION_WARN_LOGBUF_EMPTY__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7001, The log buffer is empty"
#define OB_ELECTION_WARN_NOT_RUNNING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7002, The object is not running" #define OB_ELECTION_WARN_NOT_RUNNING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7002, The object is not running"
@ -6068,7 +6071,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)" #define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)"
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld" #define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
extern int g_all_ob_errnos[2132]; extern int g_all_ob_errnos[2133];
const char *ob_error_name(const int oberr); const char *ob_error_name(const int oberr);
const char* ob_error_cause(const int oberr); const char* ob_error_cause(const int oberr);

View File

@ -388,7 +388,7 @@ int LockForReadFunctor::check_clog_disk_full_()
MTL(logservice::coordinator::ObFailureDetector *); MTL(logservice::coordinator::ObFailureDetector *);
if (NULL != detector && detector->is_clog_disk_has_fatal_error()) { if (NULL != detector && detector->is_clog_disk_has_fatal_error()) {
ret = OB_IO_ERROR; ret = detector->is_clog_disk_has_full_error()? OB_SERVER_OUTOF_DISK_SPACE: OB_CLOG_DISK_HANG;
TRANS_LOG(ERROR, "unexpected io error", K(ret), KPC(this)); TRANS_LOG(ERROR, "unexpected io error", K(ret), KPC(this));
} }