[FIX] tx data self freeze failed

This commit is contained in:
ZenoWang
2023-07-18 13:42:06 +00:00
committed by ob-robot
parent c3363fc438
commit 97daf9cb06
2 changed files with 19 additions and 9 deletions

View File

@ -515,8 +515,9 @@ int ObTenantFreezer::get_tenant_tx_data_mem_used_(int64_t &tenant_tx_data_mem_us
int ls_cnt = 0; int ls_cnt = 0;
int64_t ls_tx_data_mem_used = 0; int64_t ls_tx_data_mem_used = 0;
for (; OB_SUCC(ret) && OB_SUCC(iter->get_next(ls)); ++ls_cnt) { for (; OB_SUCC(ret) && OB_SUCC(iter->get_next(ls)); ++ls_cnt) {
if (OB_FAIL(get_ls_tx_data_mem_used_(ls, ls_tx_data_mem_used))) { int tmp_ret = OB_SUCCESS;
LOG_WARN("[TenantFreezer] fail to get tx data mem used in one ls", KR(ret)); if (OB_TMP_FAIL(get_ls_tx_data_mem_used_(ls, ls_tx_data_mem_used))) {
LOG_WARN("[TenantFreezer] fail to get tx data mem used in one ls", KR(ret), K(ls->get_ls_id()));
} else { } else {
tenant_tx_data_mem_used += ls_tx_data_mem_used; tenant_tx_data_mem_used += ls_tx_data_mem_used;
} }
@ -651,12 +652,21 @@ int ObTenantFreezer::check_and_do_freeze()
} else if (!tenant_info_.is_loaded_) { } else if (!tenant_info_.is_loaded_) {
// do nothing // do nothing
} else if (FALSE_IT(tenant_info_.get_freeze_ctx(ctx))) { } else if (FALSE_IT(tenant_info_.get_freeze_ctx(ctx))) {
} else if (OB_FAIL(check_and_freeze_normal_data_(ctx))) { } else {
LOG_WARN("[TenantFreezer] check and freeze normal data failed.", KR(ret)); int tmp_ret = OB_SUCCESS;
} else if (OB_FAIL(check_and_freeze_tx_data_())) { if (OB_TMP_FAIL(check_and_freeze_normal_data_(ctx))) {
LOG_WARN("[TenantFreezer] check and freeze tx data failed.", KR(ret)); LOG_WARN("[TenantFreezer] check and freeze normal data failed.", KR(tmp_ret));
} else if (OB_FAIL(check_and_freeze_mds_table_())) { }
LOG_WARN("[TenantFreezer] check and freeze mds table failed.", KR(ret));
tmp_ret = OB_SUCCESS;
if (OB_TMP_FAIL(check_and_freeze_tx_data_())) {
LOG_WARN("[TenantFreezer] check and freeze tx data failed.", KR(tmp_ret));
}
tmp_ret = OB_SUCCESS;
if (OB_TMP_FAIL(check_and_freeze_mds_table_())) {
LOG_WARN("[TenantFreezer] check and freeze mds table failed.", KR(tmp_ret));
}
} }
int64_t check_and_freeze_end_ts = ObTimeUtil::current_time(); int64_t check_and_freeze_end_ts = ObTimeUtil::current_time();

View File

@ -341,7 +341,7 @@ int ObTxDataMemtableMgr::get_active_memtable(ObTableHandleV2 &handle) const
MemMgrRLockGuard lock_guard(lock_); MemMgrRLockGuard lock_guard(lock_);
if (0 == memtable_tail_) { if (0 == memtable_tail_) {
ret = OB_EAGAIN; ret = OB_EAGAIN;
STORAGE_LOG(INFO, "tx data memtable is not created yet. try agagin.", K(ret), K(memtable_tail_)); STORAGE_LOG(INFO, "tx data memtable is not created yet. try agagin.", K(ret), K(ls_id_), K(memtable_tail_));
} else if (0 == get_memtable_count_()) { } else if (0 == get_memtable_count_()) {
ret = OB_ENTRY_NOT_EXIST; ret = OB_ENTRY_NOT_EXIST;
STORAGE_LOG(WARN, "the tx data memtable manager is empty. may be offline", KR(ret), K(get_memtable_count_())); STORAGE_LOG(WARN, "the tx data memtable manager is empty. may be offline", KR(ret), K(get_memtable_count_()));