[BUG] fix 4138 because unclear session timestamp
This commit is contained in:
@ -560,6 +560,16 @@ int ObSqlTransControl::start_stmt(ObExecContext &exec_ctx)
|
||||
LOG_WARN("call sql stmt end hook fail", K(tmp_ret));
|
||||
}
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)
|
||||
&& !ObSQLUtils::is_nested_sql(&exec_ctx)
|
||||
&& das_ctx.get_snapshot().core_.version_.is_valid()) {
|
||||
// maintain the read snapshot version on session for multi-version garbage
|
||||
// colloecor. It is maintained for all cases except remote exection with ac
|
||||
// = 1. So we need carefully design the version for the corner case.
|
||||
session->set_reserved_snapshot_version(das_ctx.get_snapshot().core_.version_);
|
||||
}
|
||||
|
||||
bool print_log = false;
|
||||
#ifndef NDEBUG
|
||||
print_log = true;
|
||||
@ -911,6 +921,10 @@ int ObSqlTransControl::end_stmt(ObExecContext &exec_ctx, const bool rollback)
|
||||
ret = COVER_SUCC(tmp_ret);
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret) && !ObSQLUtils::is_nested_sql(&exec_ctx)) {
|
||||
session->reset_reserved_snapshot_version();
|
||||
}
|
||||
|
||||
bool print_log = false;
|
||||
#ifndef NDEBUG
|
||||
print_log = true;
|
||||
|
||||
Reference in New Issue
Block a user