Skip to content

Commit 835d418

Browse files
committed
order import
Signed-off-by: husharp <[email protected]>
1 parent 5d97bef commit 835d418

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

integration_tests/pd_api_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ package tikv_test
3737
import (
3838
"context"
3939
"fmt"
40-
"github.com/pingcap/kvproto/pkg/metapb"
41-
"github.com/tikv/client-go/v2/config"
4240
"strings"
4341
"sync/atomic"
4442
"testing"
4543
"time"
4644

4745
"github.com/pingcap/failpoint"
4846
"github.com/pingcap/kvproto/pkg/kvrpcpb"
47+
"github.com/pingcap/kvproto/pkg/metapb"
4948
"github.com/stretchr/testify/suite"
49+
"github.com/tikv/client-go/v2/config"
5050
"github.com/tikv/client-go/v2/oracle"
5151
"github.com/tikv/client-go/v2/tikv"
5252
"github.com/tikv/client-go/v2/tikvrpc"

tikv/kv.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,6 @@ func (s *KVStore) safeTSUpdater() {
542542
}
543543
}
544544

545-
var (
546-
skipSafeTSUpdateCounter = metrics.TiKVSafeTSUpdateCounter.WithLabelValues("skip", "cluster")
547-
successSafeTSUpdateCounter = metrics.TiKVSafeTSUpdateCounter.WithLabelValues("success", "cluster")
548-
clusterMinSafeTSGap = metrics.TiKVMinSafeTSGapSeconds.WithLabelValues("cluster")
549-
)
550-
551545
func (s *KVStore) updateSafeTS(ctx context.Context) {
552546
// Try getting the cluster-level minimum resolved timestamp from PD first.
553547
if s.setGlobalMinSafeTSByPD(ctx) {
@@ -614,6 +608,12 @@ func (s *KVStore) updateSafeTS(ctx context.Context) {
614608
wg.Wait()
615609
}
616610

611+
var (
612+
skipSafeTSUpdateCounter = metrics.TiKVSafeTSUpdateCounter.WithLabelValues("skip", "cluster")
613+
successSafeTSUpdateCounter = metrics.TiKVSafeTSUpdateCounter.WithLabelValues("success", "cluster")
614+
clusterMinSafeTSGap = metrics.TiKVMinSafeTSGapSeconds.WithLabelValues("cluster")
615+
)
616+
617617
// setGlobalMinSafeTSByPD check whether it is needed to get cluster-level's min resolved ts from PD.
618618
func (s *KVStore) setGlobalMinSafeTSByPD(ctx context.Context) bool {
619619
isGlobal := config.GetTxnScopeFromConfig() == oracle.GlobalTxnScope

0 commit comments

Comments
 (0)