[FEAT MERGE] log4100 branch

Co-authored-by: tino247 <tino247@126.com>
Co-authored-by: BinChenn <binchenn.bc@gmail.com>
Co-authored-by: HaHaJeff <jeffzhouhhh@gmail.com>
This commit is contained in:
obdev
2023-01-28 18:17:31 +08:00
committed by ob-robot
parent a269ffe6be
commit 50024b39cd
772 changed files with 60275 additions and 11301 deletions

View File

@ -467,6 +467,23 @@ int ObGlobalStatProxy::select_snapshot_gc_scn_for_update(
common::ObISQLClient &sql_client,
const uint64_t tenant_id,
SCN &snapshot_gc_scn)
{
return inner_get_snapshot_gc_scn_(sql_client, tenant_id, snapshot_gc_scn, true);
}
int ObGlobalStatProxy::get_snapshot_gc_scn(
common::ObISQLClient &sql_client,
const uint64_t tenant_id,
SCN &snapshot_gc_scn)
{
return inner_get_snapshot_gc_scn_(sql_client, tenant_id, snapshot_gc_scn, false);
}
int ObGlobalStatProxy::inner_get_snapshot_gc_scn_(
common::ObISQLClient &sql_client,
const uint64_t tenant_id,
SCN &snapshot_gc_scn,
const bool is_for_update)
{
int ret = OB_SUCCESS;
uint64_t snapshot_gc_scn_val = 0;
@ -475,7 +492,7 @@ int ObGlobalStatProxy::select_snapshot_gc_scn_for_update(
ObSqlString sql;
if (OB_FAIL(sql.assign_fmt(
"SELECT column_value FROM %s WHERE TABLE_NAME = '__all_global_stat' AND COLUMN_NAME"
" = 'snapshot_gc_scn' FOR UPDATE", OB_ALL_CORE_TABLE_TNAME))) {
" = 'snapshot_gc_scn' %s", OB_ALL_CORE_TABLE_TNAME, (is_for_update ? "FOR UPDATE" : "")))) {
LOG_WARN("assign sql failed", K(ret));
} else if (OB_FAIL(sql_client.read(res, tenant_id, sql.ptr()))) {
LOG_WARN("execute sql failed", K(ret), K(sql));