File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,16 @@ package tikv_test
37
37
import (
38
38
"context"
39
39
"fmt"
40
- "github.com/pingcap/kvproto/pkg/metapb"
41
- "github.com/tikv/client-go/v2/config"
42
40
"strings"
43
41
"sync/atomic"
44
42
"testing"
45
43
"time"
46
44
47
45
"github.com/pingcap/failpoint"
48
46
"github.com/pingcap/kvproto/pkg/kvrpcpb"
47
+ "github.com/pingcap/kvproto/pkg/metapb"
49
48
"github.com/stretchr/testify/suite"
49
+ "github.com/tikv/client-go/v2/config"
50
50
"github.com/tikv/client-go/v2/oracle"
51
51
"github.com/tikv/client-go/v2/tikv"
52
52
"github.com/tikv/client-go/v2/tikvrpc"
Original file line number Diff line number Diff line change @@ -542,12 +542,6 @@ func (s *KVStore) safeTSUpdater() {
542
542
}
543
543
}
544
544
545
- var (
546
- skipSafeTSUpdateCounter = metrics .TiKVSafeTSUpdateCounter .WithLabelValues ("skip" , "cluster" )
547
- successSafeTSUpdateCounter = metrics .TiKVSafeTSUpdateCounter .WithLabelValues ("success" , "cluster" )
548
- clusterMinSafeTSGap = metrics .TiKVMinSafeTSGapSeconds .WithLabelValues ("cluster" )
549
- )
550
-
551
545
func (s * KVStore ) updateSafeTS (ctx context.Context ) {
552
546
// Try getting the cluster-level minimum resolved timestamp from PD first.
553
547
if s .setGlobalMinSafeTSByPD (ctx ) {
@@ -614,6 +608,12 @@ func (s *KVStore) updateSafeTS(ctx context.Context) {
614
608
wg .Wait ()
615
609
}
616
610
611
+ var (
612
+ skipSafeTSUpdateCounter = metrics .TiKVSafeTSUpdateCounter .WithLabelValues ("skip" , "cluster" )
613
+ successSafeTSUpdateCounter = metrics .TiKVSafeTSUpdateCounter .WithLabelValues ("success" , "cluster" )
614
+ clusterMinSafeTSGap = metrics .TiKVMinSafeTSGapSeconds .WithLabelValues ("cluster" )
615
+ )
616
+
617
617
// setGlobalMinSafeTSByPD check whether it is needed to get cluster-level's min resolved ts from PD.
618
618
func (s * KVStore ) setGlobalMinSafeTSByPD (ctx context.Context ) bool {
619
619
isGlobal := config .GetTxnScopeFromConfig () == oracle .GlobalTxnScope
You can’t perform that action at this time.
0 commit comments