check ob_max_read_stale_time when set weak_read_version_refresh_interval & blacklist logic optimization

This commit is contained in:
dimstars
2023-03-09 12:11:21 +00:00
committed by ob-robot
parent facf1c3dd5
commit c42f60968c
5 changed files with 75 additions and 4 deletions

View File

@ -636,8 +636,14 @@ int ObSqlTransControl::stmt_setup_snapshot_(ObSQLSessionInfo *session,
if (cl == ObConsistencyLevel::WEAK || cl == ObConsistencyLevel::FROZEN) {
SCN snapshot_version = SCN::min_scn();
if (OB_FAIL(txs->get_weak_read_snapshot_version(session->get_ob_max_read_stale_time(),
snapshot_version))) {
snapshot_version))) {
TRANS_LOG(WARN, "get weak read snapshot fail", KPC(txs));
int64_t stale_time = session->get_ob_max_read_stale_time();
int64_t refresh_interval = GCONF.weak_read_version_refresh_interval;
if (refresh_interval > stale_time) {
TRANS_LOG(WARN, "weak_read_version_refresh_interval is larger than ob_max_read_stale_time ",
K(refresh_interval), K(stale_time), KPC(txs));
}
} else {
snapshot.init_weak_read(snapshot_version);
}