allow minor merge when mds data incomplete and sstable cnt overflow

This commit is contained in:
Tsunaou 2024-12-16 06:14:58 +00:00 committed by ob-robot
parent c92b3bbf9d
commit 55eab841d3
3 changed files with 17 additions and 2 deletions

View File

@ -680,6 +680,7 @@ class ObString;
ACT(BEFORE_MV_FINISH_COMPLETE_REFRESH,)\
ACT(BEFORE_MIGRATION_CREATE_TABLE_STORE,)\
ACT(BEFORE_FILL_AUTO_SPLIT_PARAMS,)\
ACT(BEFORE_UPDATE_TABLET_HA_STATUS,)\
ACT(MAX_DEBUG_SYNC_POINT,)
DECLARE_ENUM(ObDebugSyncPoint, debug_sync_point, OB_DEBUG_SYNC_POINT_DEF);

View File

@ -1105,12 +1105,18 @@ int ObPartitionMergePolicy::get_multi_version_start(
if (tablet.is_ls_inner_tablet()) {
result_version_range.multi_version_start_ = INT64_MAX;
} else if (OB_FAIL(tablet.get_kept_snapshot_info(ls.get_min_reserved_snapshot(), snapshot_info))) {
if (is_mini_merge(merge_type) || OB_TENANT_NOT_EXIST == ret) {
// Minor Merge need read medium list to decide boundary snapshot and multi version start.
// Bug when ls is migrating, data is not complete and mds data can not be read.
// So if the sstable cnt is unsafe, a emergency minor should be scheduled.
const bool need_emergency_minor = OB_EAGAIN == ret && is_minor_merge_type(merge_type)
&& !tablet.get_tablet_meta().ha_status_.is_data_status_complete()
&& (tablet.get_major_table_count() + tablet.get_minor_table_count()) > OB_UNSAFE_TABLE_CNT;
if (is_mini_merge(merge_type) || OB_TENANT_NOT_EXIST == ret || need_emergency_minor) {
snapshot_info.reset();
snapshot_info.snapshot_type_ = ObStorageSnapshotInfo::SNAPSHOT_MULTI_VERSION_START_ON_TABLET;
snapshot_info.snapshot_ = tablet.get_multi_version_start();
FLOG_INFO("failed to get multi_version_start, use multi_version_start on tablet", K(ret),
"merge_type", merge_type_to_str(merge_type), K(snapshot_info));
"merge_type", merge_type_to_str(merge_type), K(snapshot_info), K(need_emergency_minor));
ret = OB_SUCCESS; // clear errno
} else {
LOG_WARN("failed to get kept multi_version_start", K(ret),

View File

@ -50,6 +50,7 @@ ERRSIM_POINT_DEF(EN_JOIN_LEARNER_LIST_FAILED);
ERRSIM_POINT_DEF(EN_MIGRATION_RPC_NOT_SUPPORT);
ERRSIM_POINT_DEF(EN_DATA_TABLET_MIGRATION_DAG_OUT_OF_RETRY);
ERRSIM_POINT_DEF(MIGRATION_START_RUNNING_FAILED);
ERRSIM_POINT_DEF(MIGRATION_WAIT_UPDATE_TABLET_HA_STATUS );
/******************ObMigrationCtx*********************/
ObMigrationCtx::ObMigrationCtx()
: ObIHADagNetCtx(),
@ -3460,6 +3461,13 @@ int ObTabletFinishMigrationTask::update_data_and_expected_status_()
{
int ret = OB_SUCCESS;
ObCopyTabletStatus::STATUS status;
#ifdef ERRSIM
int tmp_wait_tablet_id = -MIGRATION_WAIT_UPDATE_TABLET_HA_STATUS;
if (tmp_wait_tablet_id == copy_tablet_ctx_->tablet_id_.id()) {
LOG_INFO("ERRSIM MIGRATION_WAIT_UPDATE_TABLET_HA_STATUS", K(tmp_wait_tablet_id));
DEBUG_SYNC(BEFORE_UPDATE_TABLET_HA_STATUS);
}
#endif
if (!is_inited_) {
ret = OB_NOT_INIT;
LOG_WARN("tablet copy finish task do not init", K(ret));