fix backup macro block reader not reset when in inner retry process
This commit is contained in:
committed by
wangzelin.wzl
parent
d43171fc6c
commit
2a46dfbd3a
1
deps/oblib/src/lib/utility/ob_tracepoint.h
vendored
1
deps/oblib/src/lib/utility/ob_tracepoint.h
vendored
@ -633,6 +633,7 @@ class EventTable
|
|||||||
EN_ADD_BACKUP_FINISH_DAG_FAILED = 1108,
|
EN_ADD_BACKUP_FINISH_DAG_FAILED = 1108,
|
||||||
EN_ADD_BACKUP_PREFETCH_DAG_FAILED = 1109,
|
EN_ADD_BACKUP_PREFETCH_DAG_FAILED = 1109,
|
||||||
EN_BACKUP_PERSIST_SET_TASK_FAILED = 1110,
|
EN_BACKUP_PERSIST_SET_TASK_FAILED = 1110,
|
||||||
|
EN_BACKUP_READ_MACRO_BLOCK_FAILED = 1111,
|
||||||
|
|
||||||
EVENT_TABLE_MAX = SIZE_OF_EVENT_TABLE
|
EVENT_TABLE_MAX = SIZE_OF_EVENT_TABLE
|
||||||
};
|
};
|
||||||
|
|||||||
@ -420,6 +420,7 @@ class ObString;
|
|||||||
ACT(BEFORE_MIG_DDL_TABLE_MERGE_TASK,)\
|
ACT(BEFORE_MIG_DDL_TABLE_MERGE_TASK,)\
|
||||||
ACT(BEFORE_COPY_DDL_SSTABLE,)\
|
ACT(BEFORE_COPY_DDL_SSTABLE,)\
|
||||||
ACT(BEFORE_DDL_WRITE_PREPARE_LOG,)\
|
ACT(BEFORE_DDL_WRITE_PREPARE_LOG,)\
|
||||||
|
ACT(AFTER_BACKUP_FETCH_MACRO_BLOCK_FAILED,)\
|
||||||
ACT(MAX_DEBUG_SYNC_POINT,)
|
ACT(MAX_DEBUG_SYNC_POINT,)
|
||||||
|
|
||||||
DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF);
|
DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF);
|
||||||
|
|||||||
@ -19,6 +19,8 @@
|
|||||||
#include "storage/blocksstable/ob_block_manager.h"
|
#include "storage/blocksstable/ob_block_manager.h"
|
||||||
#include "storage/blocksstable/ob_macro_block_id.h"
|
#include "storage/blocksstable/ob_macro_block_id.h"
|
||||||
#include "storage/ls/ob_ls.h"
|
#include "storage/ls/ob_ls.h"
|
||||||
|
#include "lib/utility/ob_tracepoint.h"
|
||||||
|
#include "observer/ob_server_event_history_table_operator.h"
|
||||||
|
|
||||||
using namespace oceanbase::blocksstable;
|
using namespace oceanbase::blocksstable;
|
||||||
using namespace oceanbase::storage;
|
using namespace oceanbase::storage;
|
||||||
@ -403,6 +405,7 @@ int ObMultiMacroBlockBackupReader::prepare_macro_block_reader_(const int64_t idx
|
|||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("get invalid args", K(ret), K(idx), K(readers_.count()));
|
LOG_WARN("get invalid args", K(ret), K(idx), K(readers_.count()));
|
||||||
} else {
|
} else {
|
||||||
|
readers_.at(idx)->reset();
|
||||||
const ObBackupMacroBlockId ¯o_id = macro_list_.at(idx);
|
const ObBackupMacroBlockId ¯o_id = macro_list_.at(idx);
|
||||||
const common::ObLogicMacroBlockId &logic_id = macro_id.logic_id_;
|
const common::ObLogicMacroBlockId &logic_id = macro_id.logic_id_;
|
||||||
const blocksstable::MacroBlockId ¯o_block_id = macro_id.macro_block_id_;
|
const blocksstable::MacroBlockId ¯o_block_id = macro_id.macro_block_id_;
|
||||||
@ -419,12 +422,22 @@ int ObMultiMacroBlockBackupReader::fetch_macro_block_with_retry_(
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
int64_t retry_times = 0;
|
int64_t retry_times = 0;
|
||||||
while (retry_times < OB_MAX_RETRY_TIMES) {
|
while (retry_times < OB_MAX_RETRY_TIMES) {
|
||||||
if (retry_times > 1) {
|
if (retry_times >= 1) {
|
||||||
LOG_WARN("retry get macro block", K(retry_times));
|
LOG_WARN("retry get macro block", K(retry_times));
|
||||||
}
|
}
|
||||||
if (OB_FAIL(fetch_macro_block_(data, logic_id))) {
|
if (OB_FAIL(fetch_macro_block_(data, logic_id))) {
|
||||||
LOG_WARN("failed to fetch macro block", K(ret), K(retry_times));
|
LOG_WARN("failed to fetch macro block", K(ret), K(retry_times));
|
||||||
}
|
}
|
||||||
|
#ifdef ERRSIM
|
||||||
|
if (OB_SUCC(ret)) {
|
||||||
|
ret = E(EventTable::EN_BACKUP_READ_MACRO_BLOCK_FAILED) OB_SUCCESS;
|
||||||
|
if (OB_FAIL(ret)) {
|
||||||
|
SERVER_EVENT_SYNC_ADD("backup", "fetch_macro_block_failed",
|
||||||
|
"logic_id", logic_id);
|
||||||
|
DEBUG_SYNC(AFTER_BACKUP_FETCH_MACRO_BLOCK_FAILED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user