del log & fix acquired_tablet/check rs finish & bind for MTL

This commit is contained in:
obdev
2023-03-09 11:13:55 +00:00
committed by ob-robot
parent d8318ae4cf
commit 702ea5cd2d
7 changed files with 30 additions and 15 deletions

View File

@ -657,7 +657,7 @@ int MockTenantModuleEnv::init()
MTL_BIND2(mtl_new_default, checkpoint::ObTabletGCService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObLogService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantTabletScheduler::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, share::ObTenantDagScheduler::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);
MTL_BIND2(mtl_new_default, share::ObTenantDagScheduler::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantCheckpointSlogHandler::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, coordinator::ObLeaderCoordinator::mtl_init, coordinator::ObLeaderCoordinator::mtl_start, coordinator::ObLeaderCoordinator::mtl_stop, coordinator::ObLeaderCoordinator::mtl_wait, mtl_destroy_default);
MTL_BIND2(mtl_new_default, coordinator::ObFailureDetector::mtl_init, coordinator::ObFailureDetector::mtl_start, coordinator::ObFailureDetector::mtl_stop, coordinator::ObFailureDetector::mtl_wait, mtl_destroy_default);
@ -665,7 +665,7 @@ int MockTenantModuleEnv::init()
MTL_BIND2(mtl_new_default, share::detector::ObDeadLockDetectorMgr::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);
MTL_BIND2(mtl_new_default, storage::ObTenantTabletStatMgr::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default)
MTL_BIND2(mtl_new_default, storage::ObTenantSSTableMergeInfoMgr::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);
MTL_BIND2(mtl_new_default, storage::ObTenantFreezeInfoMgr::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);
MTL_BIND2(mtl_new_default, storage::ObTenantFreezeInfoMgr::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObSharedMacroBlockMgr::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObMultiVersionGarbageCollector::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(server_obj_pool_mtl_new<transaction::ObPartTransCtx>, nullptr, nullptr, nullptr, nullptr, server_obj_pool_mtl_destroy<transaction::ObPartTransCtx>);

View File

@ -388,7 +388,7 @@ int ObMultiTenant::init(ObAddr myaddr,
MTL_BIND2(mtl_new_default, ObArchiveService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, datadict::ObDataDictService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantTabletScheduler::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantDagScheduler::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantDagScheduler::mtl_init, nullptr, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTenantFreezeInfoMgr::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default);
MTL_BIND2(mtl_new_default, ObTxLoopWorker::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default); // ObTxLoopWorker
MTL_BIND2(mtl_new_default, compaction::ObTenantCompactionProgressMgr::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default);

View File

@ -574,6 +574,8 @@ int ObCompactionDiagnoseMgr::do_tenant_major_merge_diagnose(
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", KR(ret), KP(major_freeze_service));
} else {
ObTenantTabletScheduler *scheduler = MTL(ObTenantTabletScheduler*);
const int64_t frozen_scn = MAX(scheduler->get_frozen_version(), MTL(ObTenantFreezeInfoMgr*)->get_latest_frozen_version());
SMART_VAR(ObArray<ObTabletReplica>, uncompacted_tablets) {
if (OB_FAIL(major_freeze_service->get_uncompacted_tablets(uncompacted_tablets))) {
LOG_WARN("fail to get uncompacted tablets", KR(ret));
@ -582,15 +584,21 @@ int ObCompactionDiagnoseMgr::do_tenant_major_merge_diagnose(
LOG_INFO("finish get uncompacted tablets for diagnose", K(ret), K(uncompacted_tablets_cnt));
for (int64_t i = 0; (OB_SUCCESS == ret) && i < uncompacted_tablets_cnt; ++i) {
if (can_add_diagnose_info()) {
if (OB_FAIL(SET_DIAGNOSE_INFO(info_array_[idx_++], MAJOR_MERGE, MTL_ID(),
uncompacted_tablets.at(i).get_ls_id(),
uncompacted_tablets.at(i).get_tablet_id(),
ObCompactionDiagnoseInfo::DIA_STATUS_UNCOMPACTED,
ObTimeUtility::fast_current_time(),
"server", uncompacted_tablets.at(i).get_server(),
"status", uncompacted_tablets.at(i).get_status(),
"compaction_scn", uncompacted_tablets.at(i).get_snapshot_version(),
"report_scn", uncompacted_tablets.at(i).get_report_scn()))) {
bool compaction_scn_not_valid = frozen_scn > uncompacted_tablets.at(i).get_snapshot_version();
const char *status =
ObTabletReplica::SCN_STATUS_ERROR == uncompacted_tablets.at(i).get_status()
? "CHECKSUM_ERROR"
: (compaction_scn_not_valid ? "compaction_scn_not_update" : "report_scn_not_update");
if (OB_FAIL(SET_DIAGNOSE_INFO(
info_array_[idx_++], MAJOR_MERGE, MTL_ID(),
uncompacted_tablets.at(i).get_ls_id(),
uncompacted_tablets.at(i).get_tablet_id(),
ObCompactionDiagnoseInfo::DIA_STATUS_UNCOMPACTED,
ObTimeUtility::fast_current_time(), "server",
uncompacted_tablets.at(i).get_server(), "status", status,
"frozen_scn", frozen_scn,
"compaction_scn", uncompacted_tablets.at(i).get_snapshot_version(),
"report_scn", uncompacted_tablets.at(i).get_report_scn()))) {
LOG_WARN("fail to set diagnose info", KR(ret), "uncompacted_tablet",
uncompacted_tablets.at(i));
ret = OB_SUCCESS; // ignore ret, and process next uncompacted_tablet

View File

@ -257,7 +257,7 @@ int ObMediumCompactionScheduleFunc::schedule_next_medium_primary_cluster(
// for major, need select inner_table to check RS status
if (OB_FAIL(get_status_from_inner_table(ls_.get_ls_id(), tablet_.get_tablet_meta().tablet_id_, ret_info))) {
LOG_WARN("failed to get status from inner tablet", K(ret), KPC(this));
} else if (ret_info.could_schedule_next_round(last_major->get_snapshot_version())) {
} else if (ret_info.could_schedule_next_round(medium_list.get_last_compaction_scn())) {
LOG_INFO("success to check RS major checksum validation finished", K(ret), KPC(this), K(ret_info));
ret = decide_medium_snapshot(is_major);
} else {

View File

@ -402,6 +402,9 @@ int ObMediumCompactionInfoList::init(common::ObIAllocator &allocator,
if (medium_info_list_.get_size() > 0 || wait_check_flag_) {
LOG_INFO("success to init list", K(ret), KPC(this), KPC(old_list), K(finish_medium_scn),
"merge_type", merge_type_to_str(merge_type));
if (last_medium_scn_ > 0 && last_medium_scn_ < finish_medium_scn) { // only print log
LOG_WARN("medium list record old info", KPC(this), KPC(old_list), K(finish_medium_scn));
}
}
} else if (OB_UNLIKELY(!is_inited_)) {
reset();
@ -541,7 +544,7 @@ int ObMediumCompactionInfoList::inner_deep_copy_node(
ret = OB_ERR_UNEXPECTED;
LOG_WARN("medium info list is invalid", K(ret), KPC(this));
} else {
LOG_INFO("success to deep copy append medium info", K(ret), KPC(new_info));
LOG_TRACE("success to deep copy append medium info", K(ret), KPC(new_info));
}
if (OB_FAIL(ret) && nullptr != new_info) {

View File

@ -124,6 +124,10 @@ public:
{
return (ObMediumCompactionInfo::ObCompactionType)last_compaction_type_;
}
OB_INLINE int64_t get_last_compaction_scn() const
{
return last_medium_scn_;
}
void get_schedule_scn(
const int64_t major_compaction_scn,
int64_t &schedule_scn,

View File

@ -1313,7 +1313,7 @@ int ObLSTabletService::update_medium_compaction_info(
ObMetaDiskAddr disk_addr;
ObTenantMetaMemMgr *t3m = MTL(ObTenantMetaMemMgr*);
if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle))) {
if (OB_FAIL(ObTabletCreateDeleteHelper::acquire_tablet(key, new_tablet_handle, true/*only acquire*/))) {
if (OB_ENTRY_NOT_EXIST == ret) {
ret = OB_TABLET_NOT_EXIST;
} else {