fix rs progress & table_ids defense when 4013

This commit is contained in:
obdev
2024-02-09 05:35:27 +00:00
committed by ob-robot
parent b58a0a8d0c
commit ee9eb195ba
11 changed files with 50 additions and 25 deletions

View File

@ -492,7 +492,8 @@ int ObBasicTabletMergeCtx::get_merge_tables(ObGetMergeTablesResult &get_merge_ta
get_merge_table_param.merge_type_ = get_merge_type();
get_merge_table_param.merge_version_ = get_merge_version();
get_merge_table_result.error_location_ = &info_collector_.error_location_;
if (OB_FAIL(ObPartitionMergePolicy::get_merge_tables[get_merge_type()](
if (is_valid_merge_type(get_merge_type())
&& OB_FAIL(ObPartitionMergePolicy::get_merge_tables[get_merge_type()](
get_merge_table_param,
*get_ls(),
*get_tablet(),

View File

@ -1638,7 +1638,7 @@ int ObCompactionDiagnoseMgr::diagnose_no_dag(
int ret = OB_SUCCESS;
ObScheduleSuspectInfo info;
bool add_schedule_info = false;
ObSuspectInfoType suspect_type;
ObSuspectInfoType suspect_type = SUSPECT_INFO_TYPE_MAX;
char tmp_str[common::OB_DIAGNOSE_INFO_LENGTH] = "\0";
if (OB_FAIL(get_suspect_and_warning_info(dag_key, merge_type, ls_id, tablet_id, info, suspect_type, tmp_str, sizeof(tmp_str)))) {
@ -1679,7 +1679,7 @@ int ObCompactionDiagnoseMgr::diagnose_no_dag(
add_schedule_info = true;
}
if (OB_SUCC(ret) && add_schedule_info && can_add_diagnose_info()) {
if (OB_SUCC(ret) && add_schedule_info && can_add_diagnose_info() && suspect_type < SUSPECT_INFO_TYPE_MAX) {
// check tablet_type in get_diagnose_tablet_count
if (suspect_tablet_count_[suspect_type] < DIAGNOSE_TABELT_MAX_COUNT) {
if (OB_FAIL(ADD_DIAGNOSE_INFO_FOR_TABLET(

View File

@ -640,17 +640,23 @@ private:
return ret; \
}
#define DEFINE_COMPACITON_INFO_ADD_KV(n) \
template <LOG_TYPENAME_TN##n> \
void ADD_COMPACTION_INFO_PARAM(char *buf, const int64_t buf_size, LOG_PARAMETER_KV##n) \
{ \
int64_t __pos = strlen(buf); \
int ret = OB_SUCCESS; \
SIMPLE_TO_STRING_##n \
if (__pos > 0) { \
buf[__pos - 1] = ';'; \
} \
buf[__pos] = '\0'; \
#define DEFINE_COMPACITON_INFO_ADD_KV(n) \
template <LOG_TYPENAME_TN##n> \
void ADD_COMPACTION_INFO_PARAM(char *buf, const int64_t buf_size, \
LOG_PARAMETER_KV##n) { \
int64_t __pos = strlen(buf); \
int ret = OB_SUCCESS; \
SIMPLE_TO_STRING_##n \
if (__pos < 0) { \
__pos = 0; \
} else if (__pos > 0) { \
if (__pos >= buf_size) { \
__pos = buf_size - 1; \
} else { \
buf[__pos - 1] = ';'; \
} \
} \
buf[__pos] = '\0'; \
}
#define SIMPLE_TO_STRING(n) \

View File

@ -29,6 +29,8 @@ enum ObMergeType
DDL_KV_MERGE = 6, // only use for ddl dag
BACKFILL_TX_MERGE = 7,
MDS_TABLE_MERGE = 8,
// add new merge type here
// fix merge_type_to_str & ObPartitionMergePolicy::get_merge_tables
MERGE_TYPE_MAX
};

View File

@ -53,6 +53,9 @@ ObPartitionMergePolicy::GetMergeTables ObPartitionMergePolicy::get_merge_tables[
ObPartitionMergePolicy::get_mini_merge_tables,
ObPartitionMergePolicy::get_medium_merge_tables,
ObPartitionMergePolicy::get_medium_merge_tables,
ObPartitionMergePolicy::not_support_merge_type,
ObPartitionMergePolicy::not_support_merge_type,
ObPartitionMergePolicy::not_support_merge_type
};
@ -62,6 +65,7 @@ int ObPartitionMergePolicy::get_neighbour_freeze_info(
ObTenantFreezeInfoMgr::NeighbourFreezeInfo &freeze_info,
const bool is_multi_version_merge)
{
STATIC_ASSERT(static_cast<int64_t>(MERGE_TYPE_MAX) == ARRAYSIZEOF(get_merge_tables), "get merge table func cnt is mismatch");
int ret = OB_SUCCESS;
if (OB_FAIL(MTL(ObTenantFreezeInfoMgr *)->get_neighbour_major_freeze(snapshot_version, freeze_info))) {
if (OB_ENTRY_NOT_EXIST == ret) {

View File

@ -67,6 +67,14 @@ public:
storage::ObLS &ls,
const storage::ObTablet &tablet,
storage::ObGetMergeTablesResult &result);
static int not_support_merge_type(
const storage::ObGetMergeTablesParam &param,
storage::ObLS &ls,
const storage::ObTablet &tablet,
storage::ObGetMergeTablesResult &result)
{
return OB_NOT_SUPPORTED;
}
static int check_need_medium_merge(
storage::ObLS &ls,
storage::ObTablet &tablet,

View File

@ -266,6 +266,7 @@ int64_t ObMergeParameter::to_string(char* buf, const int64_t buf_len) const
ObCompactionParam::ObCompactionParam()
: score_(0),
occupy_size_(0),
estimate_phy_size_(0),
replay_interval_(0),
add_time_(0),
last_end_scn_(),