diff --git a/src/storage/tx/ob_tx_api.cpp b/src/storage/tx/ob_tx_api.cpp index 4e2775905b..56f7eb2c05 100644 --- a/src/storage/tx/ob_tx_api.cpp +++ b/src/storage/tx/ob_tx_api.cpp @@ -552,7 +552,7 @@ int ObTransService::get_read_snapshot(ObTxDesc &tx, snapshot.uncertain_bound_))) { TRANS_LOG(WARN, "acquire global snapshot fail", K(ret), K(tx)); } else { - if (tx.is_can_elr()) { + if (tx.is_can_elr() && MTL_IS_PRIMARY_TENANT()) { snapshot.core_.version_ = std::max(snapshot.core_.version_, tx_version_mgr_.get_max_commit_ts(true)); } } diff --git a/src/storage/tx/ob_tx_elr_util.cpp b/src/storage/tx/ob_tx_elr_util.cpp index 7ba9c4b95a..2ef9786401 100644 --- a/src/storage/tx/ob_tx_elr_util.cpp +++ b/src/storage/tx/ob_tx_elr_util.cpp @@ -23,11 +23,13 @@ namespace transaction int ObTxELRUtil::check_and_update_tx_elr_info(ObTxDesc &tx) { int ret = OB_SUCCESS; - if (can_tenant_elr_ && OB_SYS_TENANT_ID != MTL_ID()) { // tenant config enable elr - tx.set_can_elr(true); - TX_STAT_ELR_ENABLE_TRANS_INC(MTL_ID()); + if (OB_SYS_TENANT_ID != MTL_ID() && MTL_IS_PRIMARY_TENANT()) { + if (can_tenant_elr_) { // tenant config enable elr + tx.set_can_elr(true); + TX_STAT_ELR_ENABLE_TRANS_INC(MTL_ID()); + } + refresh_elr_tenant_config_(); } - refresh_elr_tenant_config_(); return ret; }