From 3e32eb29e77fd6620dba199855cb173c520d7dd5 Mon Sep 17 00:00:00 2001 From: okJiang <819421878@qq.com> Date: Wed, 11 Dec 2024 11:45:47 +0800 Subject: [PATCH] fix local tso Signed-off-by: okJiang <819421878@qq.com> --- oracle/oracles/pd.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/oracle/oracles/pd.go b/oracle/oracles/pd.go index b5b0c5f65..45ef676fd 100644 --- a/oracle/oracles/pd.go +++ b/oracle/oracles/pd.go @@ -246,11 +246,7 @@ func (f *tsFuture) Wait() (uint64, error) { func (o *pdOracle) GetTimestampAsync(ctx context.Context, opt *oracle.Option) oracle.Future { var ts pd.TSFuture - if opt.TxnScope == oracle.GlobalTxnScope || opt.TxnScope == "" { - ts = o.c.GetTSAsync(ctx) - } else { - ts = o.c.GetLocalTSAsync(ctx, opt.TxnScope) - } + ts = o.c.GetTSAsync(ctx) return &tsFuture{ts, o, opt.TxnScope} } @@ -260,11 +256,7 @@ func (o *pdOracle) getTimestamp(ctx context.Context, txnScope string) (uint64, e physical, logical int64 err error ) - if txnScope == oracle.GlobalTxnScope || txnScope == "" { - physical, logical, err = o.c.GetTS(ctx) - } else { - physical, logical, err = o.c.GetLocalTS(ctx, txnScope) - } + physical, logical, err = o.c.GetTS(ctx) if err != nil { return 0, errors.WithStack(err) }