do not read by ELR when tenant is not primary
This commit is contained in:
@ -552,7 +552,7 @@ int ObTransService::get_read_snapshot(ObTxDesc &tx,
|
|||||||
snapshot.uncertain_bound_))) {
|
snapshot.uncertain_bound_))) {
|
||||||
TRANS_LOG(WARN, "acquire global snapshot fail", K(ret), K(tx));
|
TRANS_LOG(WARN, "acquire global snapshot fail", K(ret), K(tx));
|
||||||
} else {
|
} 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));
|
snapshot.core_.version_ = std::max(snapshot.core_.version_, tx_version_mgr_.get_max_commit_ts(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,11 +23,13 @@ namespace transaction
|
|||||||
int ObTxELRUtil::check_and_update_tx_elr_info(ObTxDesc &tx)
|
int ObTxELRUtil::check_and_update_tx_elr_info(ObTxDesc &tx)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (can_tenant_elr_ && OB_SYS_TENANT_ID != MTL_ID()) { // tenant config enable elr
|
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.set_can_elr(true);
|
||||||
TX_STAT_ELR_ENABLE_TRANS_INC(MTL_ID());
|
TX_STAT_ELR_ENABLE_TRANS_INC(MTL_ID());
|
||||||
}
|
}
|
||||||
refresh_elr_tenant_config_();
|
refresh_elr_tenant_config_();
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user