diff --git a/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.cpp b/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.cpp index 88e7b1ebfd0f1c8f97a5b2b947e052748c79b648..6185705c67fef99888940d82a03a78c1173d4981 100644 --- a/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.cpp +++ b/src/storage/memtable/mvcc/ob_mvcc_trans_ctx.cpp @@ -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) { diff --git a/src/storage/memtable/ob_memtable.h b/src/storage/memtable/ob_memtable.h index 583ec99b212c94e8435a7ccc0f6094c0ae8c8090..e86dd3649ef8b84f45d1c8b286a5bf4bfdc0fefc 100644 --- a/src/storage/memtable/ob_memtable.h +++ b/src/storage/memtable/ob_memtable.h @@ -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 diff --git a/src/storage/ob_partition_scheduler.cpp b/src/storage/ob_partition_scheduler.cpp index d236fadf74084e9c8dd3bd0b26bf74afcf15d382..803ec885cbe01f69d35853408f50623d174c8408 100644 --- a/src/storage/ob_partition_scheduler.cpp +++ b/src/storage/ob_partition_scheduler.cpp @@ -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()) { diff --git a/src/storage/ob_pg_storage.cpp b/src/storage/ob_pg_storage.cpp index 577ae84f7bd3447cd52493db4afd055dbbad31a1..6c5685ea8e6389c65b66ca679e1283cbce424de2 100644 --- a/src/storage/ob_pg_storage.cpp +++ b/src/storage/ob_pg_storage.cpp @@ -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)); + } } }