diff --git a/src/sql/ob_sql_trans_control.cpp b/src/sql/ob_sql_trans_control.cpp index f51704afda..20a2ab24fe 100644 --- a/src/sql/ob_sql_trans_control.cpp +++ b/src/sql/ob_sql_trans_control.cpp @@ -1202,7 +1202,8 @@ int ObSqlTransControl::check_ls_readable(const uint64_t tenant_id, || max_stale_time_us <= -2) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ls_id), K(addr), K(max_stale_time_us)); - } else if (max_stale_time_us < 0) { + } else if (max_stale_time_us < 0 + || GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_4_2_0_0) { // no need check can_read = true; } else if (observer::ObServer::get_instance().get_self() == addr) { diff --git a/src/storage/tx/ob_tx_api.cpp b/src/storage/tx/ob_tx_api.cpp index b1f6d4121d..a27cf41d38 100644 --- a/src/storage/tx/ob_tx_api.cpp +++ b/src/storage/tx/ob_tx_api.cpp @@ -730,7 +730,9 @@ int ObTransService::get_weak_read_snapshot_version(const int64_t max_read_stale_ // do nothing } if (OB_SUCC(ret)) { - if (max_read_stale_us_for_user < 0) { + if (monotinic_read + || max_read_stale_us_for_user < 0 + || GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_4_2_0_0) { // no need to check barrier version snapshot = wrs_scn; } else { @@ -742,7 +744,7 @@ int ObTransService::get_weak_read_snapshot_version(const int64_t max_read_stale_ } else { const int64_t current_time_us = MTL_IS_PRIMARY_TENANT() ? std::max(ObTimeUtility::current_time(), gts_cache.convert_to_ts()) - : 0 ; + : gts_cache.convert_to_ts(); current_scn.convert_from_ts(current_time_us - max_read_stale_us_for_user); snapshot = SCN::max(wrs_scn, current_scn); }