fix sys tenant no fast freeze bug
This commit is contained in:
@ -1141,6 +1141,10 @@ int ObMvccRowCallback::trans_commit(const bool for_replay)
|
||||
if (value_.total_trans_node_cnt_ >= MAX_TRANS_NODE_CNT) {
|
||||
ctx_.set_contain_hotspot_row();
|
||||
}
|
||||
//print debug log when total trans node cnt great to 200 * 10000;
|
||||
if (value_.total_trans_node_cnt_ > 2000000 && REACH_TIME_INTERVAL(120 * 1000 * 1000)) {
|
||||
TRANS_LOG(INFO, "[FF] trans commit succ", K_(ctx), K_(value));
|
||||
}
|
||||
(void)ATOMIC_FAA(&value_.update_since_compact_, 1);
|
||||
if (value_.need_compact(for_read, for_replay)) {
|
||||
if (for_replay) {
|
||||
|
||||
@ -362,7 +362,7 @@ public:
|
||||
INHERIT_TO_STRING_KV("ObITable", ObITable, KP(this), K_(timestamp), K_(active_trx_count), K_(state),
|
||||
K_(max_schema_version), K_(write_ref_cnt), K_(local_allocator), K_(with_accurate_log_ts_range), K_(frozen),
|
||||
K_(frozen_log_applied), K_(mark_finish), K_(pending_cb_cnt), K_(pending_lob_cnt), K_(pending_batch_commit_cnt),
|
||||
K_(pending_elr_cnt));
|
||||
K_(pending_elr_cnt), K_(contain_hotspot_row));
|
||||
|
||||
private:
|
||||
static const int64_t OB_EMPTY_MEMSTORE_MAX_SIZE = 10L << 20; // 10MB
|
||||
|
||||
@ -1204,8 +1204,10 @@ int ObPartitionScheduler::schedule_pg(
|
||||
if (OB_ENTRY_NOT_EXIST != tmp_ret) {
|
||||
LOG_WARN("Failed to check need fast freeze for hotspot table", K(tmp_ret), K(pg_key));
|
||||
}
|
||||
} else if (!need_fast_freeze) {
|
||||
|
||||
}
|
||||
// ignore tmp_ret
|
||||
if (!need_fast_freeze) {
|
||||
// do nothing
|
||||
} else if (OB_SUCCESS != (tmp_ret = partition_service_->minor_freeze(pg_key))) {
|
||||
LOG_WARN("Failed to schedule fast freeze", K(tmp_ret), K(pg_key));
|
||||
} else {
|
||||
@ -2510,8 +2512,7 @@ ObFastFreezeChecker::ObFastFreezeChecker(const int64_t tenant_id)
|
||||
reset();
|
||||
if (OB_UNLIKELY(tenant_id == OB_INVALID_TENANT_ID)) {
|
||||
LOG_WARN("Invalid tenant id to init fast freeze checker", K(tenant_id));
|
||||
} else if (OB_SYS_TENANT_ID != tenant_id) {
|
||||
// fast freeze only trigger for user tenant
|
||||
} else {
|
||||
tenant_id_ = tenant_id;
|
||||
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id_));
|
||||
if (tenant_config.is_valid()) {
|
||||
|
||||
@ -1901,7 +1901,11 @@ int ObPGStorage::check_active_mt_hotspot_row_exist(bool& has_hotspot_row, const
|
||||
} else if (OB_FAIL(get_all_pg_partition_keys_(pkeys))) {
|
||||
STORAGE_LOG(WARN, "get all pg partition keys error", K(ret), K(pkey_), K(pkeys));
|
||||
} else if (pkeys.count() <= 0 || ObTimeUtility::current_time() < last_freeze_ts_ + fast_freeze_interval) {
|
||||
// do nothing
|
||||
if (REACH_TIME_INTERVAL(120 * 1000 * 1000)) {
|
||||
TRANS_LOG(INFO, "[FF] no need to check active hotspot row", K_(pkey),
|
||||
K_(last_freeze_ts),
|
||||
K(fast_freeze_interval));
|
||||
}
|
||||
} else {
|
||||
ObTableHandle handle;
|
||||
memtable::ObMemtable* memtable = NULL;
|
||||
@ -1918,6 +1922,9 @@ int ObPGStorage::check_active_mt_hotspot_row_exist(bool& has_hotspot_row, const
|
||||
STORAGE_LOG(ERROR, " memtable is NULL", K(ret), K(pkey_));
|
||||
} else {
|
||||
has_hotspot_row = memtable->has_hotspot_row();
|
||||
if (has_hotspot_row && REACH_TIME_INTERVAL(120 * 1000 * 1000)) {
|
||||
TRANS_LOG(INFO, "[FF] current memtable has hotspot row", K(pkey_), K(*memtable), K(fast_freeze_interval));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user