From 5b3e2667238b92119ec7d73841abf9a15e96a197 Mon Sep 17 00:00:00 2001 From: ekexium Date: Thu, 18 Apr 2024 15:51:40 +0800 Subject: [PATCH 01/22] log: log the resolve progress of pipelined-dml every 30s (#1291) Signed-off-by: ekexium --- txnkv/rangetask/range_task.go | 13 ++++++++++++- txnkv/transaction/pipelined_flush.go | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/txnkv/rangetask/range_task.go b/txnkv/rangetask/range_task.go index bba5a1d3ec..dc5acecd02 100644 --- a/txnkv/rangetask/range_task.go +++ b/txnkv/rangetask/range_task.go @@ -97,7 +97,13 @@ func NewRangeTaskRunner( concurrency int, handler TaskHandler, ) *Runner { - return NewRangeTaskRunnerWithID(name, "", store, concurrency, handler) + return NewRangeTaskRunnerWithID( + name, + "", + store, + concurrency, + handler, + ) } // NewRangeTaskRunnerWithID creates a RangeTaskRunner with a specified identifier @@ -123,6 +129,11 @@ func NewRangeTaskRunnerWithID( } } +// SetStatLogInterval sets the statsLogInterval +func (s *Runner) SetStatLogInterval(interval time.Duration) { + s.statLogInterval = interval +} + // SetRegionsPerTask sets how many regions is in a divided task. Since regions may split and merge, it's possible that // a sub task contains not exactly specified number of regions. func (s *Runner) SetRegionsPerTask(regionsPerTask int) { diff --git a/txnkv/transaction/pipelined_flush.go b/txnkv/transaction/pipelined_flush.go index 78338b992b..9703daa88b 100644 --- a/txnkv/transaction/pipelined_flush.go +++ b/txnkv/transaction/pipelined_flush.go @@ -453,6 +453,7 @@ func (c *twoPhaseCommitter) resolveFlushedLocks(bo *retry.Backoffer, start, end RESOLVE_CONCURRENCY, handler, ) + runner.SetStatLogInterval(30 * time.Second) go func() { if err = runner.RunOnRange(bo.GetCtx(), start, end); err != nil { From e02b025475c808b497938d8bc53e8f0b145b2b2f Mon Sep 17 00:00:00 2001 From: ekexium Date: Thu, 18 Apr 2024 16:47:21 +0800 Subject: [PATCH 02/22] log: only log the first lock in every flush or prewrite response (#1295) * log: only log the first lock in every flush or prewrite response Signed-off-by: ekexium * log each conflicting txn at most once Signed-off-by: ekexium * log: ttlManager Signed-off-by: ekexium --------- Signed-off-by: ekexium --- txnkv/transaction/2pc.go | 17 +++++++++++++---- txnkv/transaction/pipelined_flush.go | 17 +++++++++++------ txnkv/transaction/prewrite.go | 17 +++++++++++------ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/txnkv/transaction/2pc.go b/txnkv/transaction/2pc.go index e671f39f19..ddfe17ad3d 100644 --- a/txnkv/transaction/2pc.go +++ b/txnkv/transaction/2pc.go @@ -1219,7 +1219,9 @@ func keepAlive( logutil.Logger(bo.GetCtx()).Info("ttlManager live up to its lifetime", zap.Uint64("txnStartTS", c.startTS), zap.Uint64("uptime", uptime), - zap.Uint64("maxTxnTTL", config.GetGlobalConfig().MaxTxnTTL)) + zap.Uint64("maxTxnTTL", config.GetGlobalConfig().MaxTxnTTL), + zap.Bool("isPipelinedTxn", isPipelinedTxn), + ) metrics.TiKVTTLLifeTimeReachCounter.Inc() // the pessimistic locks may expire if the ttl manager has timed out, set `LockExpired` flag // so that this transaction could only commit or rollback with no more statement executions @@ -1231,7 +1233,10 @@ func keepAlive( newTTL := uptime + atomic.LoadUint64(&ManagedLockTTL) logutil.Logger(bo.GetCtx()).Info("send TxnHeartBeat", - zap.Uint64("startTS", c.startTS), zap.Uint64("newTTL", newTTL)) + zap.Uint64("startTS", c.startTS), + zap.Uint64("newTTL", newTTL), + zap.Bool("isPipelinedTxn", isPipelinedTxn), + ) startTime := time.Now() _, stopHeartBeat, err := sendTxnHeartBeat(bo, c.store, primaryKey, c.startTS, newTTL) if err != nil { @@ -1239,12 +1244,16 @@ func keepAlive( metrics.TxnHeartBeatHistogramError.Observe(time.Since(startTime).Seconds()) logutil.Logger(bo.GetCtx()).Debug("send TxnHeartBeat failed", zap.Error(err), - zap.Uint64("txnStartTS", c.startTS)) + zap.Uint64("txnStartTS", c.startTS), + zap.Bool("isPipelinedTxn", isPipelinedTxn), + ) if stopHeartBeat || keepFail > maxConsecutiveFailure { logutil.Logger(bo.GetCtx()).Warn("stop TxnHeartBeat", zap.Error(err), zap.Int("consecutiveFailure", keepFail), - zap.Uint64("txnStartTS", c.startTS)) + zap.Uint64("txnStartTS", c.startTS), + zap.Bool("isPipelinedTxn", isPipelinedTxn), + ) return } continue diff --git a/txnkv/transaction/pipelined_flush.go b/txnkv/transaction/pipelined_flush.go index 9703daa88b..01a14d4f9f 100644 --- a/txnkv/transaction/pipelined_flush.go +++ b/txnkv/transaction/pipelined_flush.go @@ -215,6 +215,7 @@ func (action actionPipelinedFlush) handleSingleBatch( } locks := make([]*txnlock.Lock, 0, len(keyErrs)) + logged := make(map[uint64]struct{}, 1) for _, keyErr := range keyErrs { // Check already exists error if alreadyExist := keyErr.GetAlreadyExist(); alreadyExist != nil { @@ -227,12 +228,16 @@ func (action actionPipelinedFlush) handleSingleBatch( if err1 != nil { return err1 } - logutil.Logger(bo.GetCtx()).Info( - "[pipelined dml] encounters lock", - zap.Uint64("txnID", c.startTS), - zap.Uint64("generation", action.generation), - zap.Stringer("lock", lock), - ) + if _, ok := logged[lock.TxnID]; !ok { + logutil.Logger(bo.GetCtx()).Info( + "[pipelined dml] flush encounters lock. "+ + "More locks belonging to the same transaction may be omitted", + zap.Uint64("txnID", c.startTS), + zap.Uint64("generation", action.generation), + zap.Stringer("lock", lock), + ) + logged[lock.TxnID] = struct{}{} + } // If an optimistic transaction encounters a lock with larger TS, this transaction will certainly // fail due to a WriteConflict error. So we can construct and return an error here early. // Pessimistic transactions don't need such an optimization. If this key needs a pessimistic lock, diff --git a/txnkv/transaction/prewrite.go b/txnkv/transaction/prewrite.go index ba6e415744..a50e407198 100644 --- a/txnkv/transaction/prewrite.go +++ b/txnkv/transaction/prewrite.go @@ -429,6 +429,7 @@ func (action actionPrewrite) handleSingleBatch( return nil } var locks []*txnlock.Lock + logged := make(map[uint64]struct{}) for _, keyErr := range keyErrs { // Check already exists error if alreadyExist := keyErr.GetAlreadyExist(); alreadyExist != nil { @@ -441,12 +442,16 @@ func (action actionPrewrite) handleSingleBatch( if err1 != nil { return err1 } - logutil.BgLogger().Info( - "prewrite encounters lock", - zap.Uint64("session", c.sessionID), - zap.Uint64("txnID", c.startTS), - zap.Stringer("lock", lock), - ) + if _, ok := logged[lock.TxnID]; !ok { + logutil.BgLogger().Info( + "prewrite encounters lock. "+ + "More locks belonging to the same transaction may be omitted", + zap.Uint64("session", c.sessionID), + zap.Uint64("txnID", c.startTS), + zap.Stringer("lock", lock), + ) + logged[lock.TxnID] = struct{}{} + } // If an optimistic transaction encounters a lock with larger TS, this transaction will certainly // fail due to a WriteConflict error. So we can construct and return an error here early. // Pessimistic transactions don't need such an optimization. If this key needs a pessimistic lock, From 09b120cdf7142c9d6a1b61f4c34066701ae15fba Mon Sep 17 00:00:00 2001 From: zyguan Date: Thu, 18 Apr 2024 20:14:18 +0800 Subject: [PATCH 03/22] region_cache: fix issue that LocateKey may returns a wrong region (#1299) * region_cache: fix issue that LocateKey may returns a wrong region Signed-off-by: zyguan * address the comment Signed-off-by: zyguan --------- Signed-off-by: zyguan --- internal/locate/region_cache.go | 17 +++++--------- internal/locate/region_cache_test.go | 33 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/internal/locate/region_cache.go b/internal/locate/region_cache.go index e109db5a7b..2d16e235be 100644 --- a/internal/locate/region_cache.go +++ b/internal/locate/region_cache.go @@ -1318,18 +1318,10 @@ func (c *RegionCache) findRegionByKey(bo *retry.Backoffer, key []byte, isEndKey } } else if flags := r.resetSyncFlags(needReloadOnAccess | needDelayedReloadReady); flags > 0 { // load region when it be marked as need reload. - reloadOnAccess := flags&needReloadOnAccess > 0 - var ( - lr *Region - err error - ) - if reloadOnAccess { - observeLoadRegion(tag, r, expired, flags) - lr, err = c.loadRegion(bo, key, isEndKey) - } else { - observeLoadRegion("ByID", r, expired, flags) - lr, err = c.loadRegionByID(bo, r.GetID()) - } + observeLoadRegion(tag, r, expired, flags) + // NOTE: we can NOT use c.loadRegionByID(bo, r.GetID()) here because the new region (loaded by id) is not + // guaranteed to contain the key. (ref: https://github.com/tikv/client-go/pull/1299) + lr, err := c.loadRegion(bo, key, isEndKey) if err != nil { // ignore error and use old region info. logutil.Logger(bo.GetCtx()).Error("load region failure", @@ -1337,6 +1329,7 @@ func (c *RegionCache) findRegionByKey(bo *retry.Backoffer, key []byte, isEndKey zap.String("encode-key", util.HexRegionKeyStr(c.codec.EncodeRegionKey(key)))) } else { logutil.Eventf(bo.GetCtx(), "load region %d from pd, due to need-reload", lr.GetID()) + reloadOnAccess := flags&needReloadOnAccess > 0 r = lr c.mu.Lock() c.insertRegionToCache(r, reloadOnAccess, reloadOnAccess) diff --git a/internal/locate/region_cache_test.go b/internal/locate/region_cache_test.go index 3369fc4fd1..8bffee0c86 100644 --- a/internal/locate/region_cache_test.go +++ b/internal/locate/region_cache_test.go @@ -2204,6 +2204,39 @@ func (s *testRegionCacheSuite) TestRegionCacheHandleHealthStatus() { s.False(store2.healthStatus.IsSlow()) } +func (s *testRegionCacheSuite) TestSplitThenLocateInvalidRegion() { + s.testSplitThenLocateKey(func(r *Region) { r.invalidate(Other) }) +} + +func (s *testRegionCacheSuite) TestSplitThenLocateRegionNeedReloadOnAccess() { + s.testSplitThenLocateKey(func(r *Region) { r.setSyncFlags(needReloadOnAccess) }) +} + +func (s *testRegionCacheSuite) TestSplitThenLocateRegionNeedDelayedReload() { + s.testSplitThenLocateKey(func(r *Region) { r.setSyncFlags(needDelayedReloadReady) }) +} + +func (s *testRegionCacheSuite) testSplitThenLocateKey(markRegion func(r *Region)) { + k := []byte("k") + + // load region to cache + _, err := s.cache.LocateRegionByID(s.bo, s.region1) + s.NoError(err) + r1, expired := s.cache.searchCachedRegionByKey(k, false) + s.NotNil(r1) + s.False(expired) + + // split region and mark it need sync + r2ids := s.cluster.AllocIDs(3) + s.cluster.Split(s.region1, r2ids[0], k, r2ids[1:], r2ids[1]) + markRegion(r1) + + // locate key + loc, err := s.cache.LocateKey(s.bo, k) + s.NoError(err) + s.True(loc.Contains(k)) +} + func (s *testRegionRequestToSingleStoreSuite) TestRefreshCache() { _ = s.cache.refreshRegionIndex(s.bo) r, _ := s.cache.scanRegionsFromCache(s.bo, []byte{}, nil, 10) From 36c8d2c6680ac33eaca2e0ad374018c3c728edf3 Mon Sep 17 00:00:00 2001 From: zyguan Date: Thu, 18 Apr 2024 21:37:35 +0800 Subject: [PATCH 04/22] region_cache: extract store related fields to store cache (#1279) Signed-off-by: zyguan Co-authored-by: cfzjywxk --- internal/locate/region_cache.go | 70 ++++------- internal/locate/region_cache_test.go | 56 ++++----- internal/locate/region_request.go | 6 +- internal/locate/region_request3_test.go | 16 +-- internal/locate/region_request_state_test.go | 4 +- internal/locate/region_request_test.go | 2 +- internal/locate/replica_selector_test.go | 6 +- internal/locate/store_cache.go | 115 ++++++++++++------- 8 files changed, 144 insertions(+), 131 deletions(-) diff --git a/internal/locate/region_cache.go b/internal/locate/region_cache.go index 2d16e235be..b74c10af51 100644 --- a/internal/locate/region_cache.go +++ b/internal/locate/region_cache.go @@ -326,11 +326,11 @@ func newRegion(bo *retry.Backoffer, c *RegionCache, pdRegion *pd.Region) (*Regio var leaderAccessIdx AccessIndex availablePeers := r.meta.GetPeers()[:0] for _, p := range r.meta.Peers { - store, exists := c.getStore(p.StoreId) + store, exists := c.stores.get(p.StoreId) if !exists { - store = c.getStoreOrInsertDefault(p.StoreId) + store = c.stores.getOrInsertDefault(p.StoreId) } - addr, err := store.initResolve(bo, c) + addr, err := store.initResolve(bo, c.stores) if err != nil { return nil, err } @@ -633,25 +633,11 @@ type RegionCache struct { mu regionIndexMu - storeMu struct { - sync.RWMutex - stores map[uint64]*Store - } - tiflashComputeStoreMu struct { - sync.RWMutex - needReload bool - stores []*Store - } - notifyCheckCh chan struct{} + stores storeCache // runner for background jobs bg *bgRunner - testingKnobs struct { - // Replace the requestLiveness function for test purpose. Note that in unit tests, if this is not set, - // requestLiveness always returns unreachable. - mockRequestLiveness atomic.Pointer[livenessFunc] - } clusterID uint64 } @@ -681,10 +667,7 @@ func NewRegionCache(pdClient pd.Client, opt ...RegionCacheOpt) *RegionCache { c.codec = codecPDClient.GetCodec() } - c.storeMu.stores = make(map[uint64]*Store) - c.tiflashComputeStoreMu.needReload = true - c.tiflashComputeStoreMu.stores = make([]*Store, 0) - c.notifyCheckCh = make(chan struct{}, 1) + c.stores = newStoreCache(pdClient) c.bg = newBackgroundRunner(context.Background()) c.enableForwarding = config.GetGlobalConfig().EnableForwarding if c.pdClient != nil { @@ -719,7 +702,7 @@ func NewRegionCache(pdClient pd.Client, opt ...RegionCacheOpt) *RegionCache { } needCheckStores = c.checkAndResolve(needCheckStores[:0], func(s *Store) bool { return filter(s.getResolveState()) }) return false - }, time.Duration(refreshStoreInterval/4)*time.Second, c.getCheckStoreEvents()) + }, time.Duration(refreshStoreInterval/4)*time.Second, c.stores.getCheckStoreEvents()) if !options.noHealthTick { c.bg.schedule(repeat(c.checkAndUpdateStoreHealthStatus), time.Duration(refreshStoreInterval/4)*time.Second) } @@ -741,10 +724,6 @@ func NewRegionCache(pdClient pd.Client, opt ...RegionCacheOpt) *RegionCache { // only used fot test. func newTestRegionCache() *RegionCache { c := &RegionCache{} - c.storeMu.stores = make(map[uint64]*Store) - c.tiflashComputeStoreMu.needReload = true - c.tiflashComputeStoreMu.stores = make([]*Store, 0) - c.notifyCheckCh = make(chan struct{}, 1) c.bg = newBackgroundRunner(context.Background()) c.mu = *newRegionIndexMu(nil) return c @@ -753,7 +732,7 @@ func newTestRegionCache() *RegionCache { // clear clears all cached data in the RegionCache. It's only used in tests. func (c *RegionCache) clear() { c.mu.refresh(nil) - c.clearStores() + c.stores.clear() } // thread unsafe, should use with lock @@ -778,9 +757,9 @@ func (c *RegionCache) checkAndResolve(needCheckStores []*Store, needCheck func(* } }() - needCheckStores = c.filterStores(needCheckStores, needCheck) + needCheckStores = c.stores.filter(needCheckStores, needCheck) for _, store := range needCheckStores { - _, err := store.reResolve(c) + _, err := store.reResolve(c.stores) tikverr.Log(err) } return needCheckStores @@ -788,12 +767,13 @@ func (c *RegionCache) checkAndResolve(needCheckStores []*Store, needCheck func(* // SetRegionCacheStore is used to set a store in region cache, for testing only func (c *RegionCache) SetRegionCacheStore(id uint64, addr string, peerAddr string, storeType tikvrpc.EndpointType, state uint64, labels []*metapb.StoreLabel) { - c.putStore(newStore(id, addr, peerAddr, "", storeType, resolveState(state), labels)) + c.stores.put(newStore(id, addr, peerAddr, "", storeType, resolveState(state), labels)) } // SetPDClient replaces pd client,for testing only func (c *RegionCache) SetPDClient(client pd.Client) { c.pdClient = client + c.stores = newStoreCache(client) } // RPCContext contains data that is needed to send RPC to a region. @@ -1057,7 +1037,7 @@ func (c *RegionCache) GetTiFlashRPCContext(bo *retry.Backoffer, id RegionVerID, return nil, nil } if store.getResolveState() == needCheck { - _, err := store.reResolve(c) + _, err := store.reResolve(c.stores) tikverr.Log(err) } regionStore.workTiFlashIdx.Store(int32(accessIdx)) @@ -1406,7 +1386,7 @@ func (c *RegionCache) markRegionNeedBeRefill(s *Store, storeIdx int, rs *regionS metrics.RegionCacheCounterWithInvalidateStoreRegionsOK.Inc() } // schedule a store addr resolve. - c.markStoreNeedCheck(s) + c.stores.markStoreNeedCheck(s) return incEpochStoreIdx } @@ -1759,14 +1739,14 @@ func (c *RegionCache) searchCachedRegionByID(regionID uint64) (*Region, bool) { // GetStoresByType gets stores by type `typ` func (c *RegionCache) GetStoresByType(typ tikvrpc.EndpointType) []*Store { - return c.filterStores(nil, func(s *Store) bool { + return c.stores.filter(nil, func(s *Store) bool { return s.getResolveState() == resolved && s.storeType == typ }) } // GetAllStores gets TiKV and TiFlash stores. func (c *RegionCache) GetAllStores() []*Store { - return c.filterStores(nil, func(s *Store) bool { + return c.stores.filter(nil, func(s *Store) bool { return s.getResolveState() == resolved && (s.storeType == tikvrpc.TiKV || s.storeType == tikvrpc.TiFlash) }) } @@ -2037,7 +2017,7 @@ func (c *RegionCache) getStoreAddr(bo *retry.Backoffer, region *Region, store *S addr = store.addr return case unresolved: - addr, err = store.initResolve(bo, c) + addr, err = store.initResolve(bo, c.stores) return case deleted: addr = c.changeToActiveStore(region, store.storeID) @@ -2094,7 +2074,7 @@ func (c *RegionCache) getProxyStore(region *Region, store *Store, rs *regionStor // changeToActiveStore replace the deleted store in the region by an up-to-date store in the stores map. // The order is guaranteed by reResolve() which adds the new store before marking old store deleted. func (c *RegionCache) changeToActiveStore(region *Region, storeID uint64) (addr string) { - store, _ := c.getStore(storeID) + store, _ := c.stores.get(storeID) for { oldRegionStore := region.getStore() newRegionStore := oldRegionStore.clone() @@ -2204,19 +2184,19 @@ func (c *RegionCache) PDClient() pd.Client { // GetTiFlashStores returns the information of all tiflash nodes. Like `GetAllStores`, the method only returns resolved // stores so that users won't be bothered by tombstones. (related issue: https://github.com/pingcap/tidb/issues/46602) func (c *RegionCache) GetTiFlashStores(labelFilter LabelFilter) []*Store { - return c.filterStores(nil, func(s *Store) bool { + return c.stores.filter(nil, func(s *Store) bool { return s.storeType == tikvrpc.TiFlash && labelFilter(s.labels) && s.getResolveState() == resolved }) } // GetTiFlashComputeStores returns all stores with lable . func (c *RegionCache) GetTiFlashComputeStores(bo *retry.Backoffer) (res []*Store, err error) { - stores, needReload := c.listTiflashComputeStores() + stores, needReload := c.stores.listTiflashComputeStores() if needReload { - stores, err = reloadTiFlashComputeStores(bo.GetCtx(), c) + stores, err = reloadTiFlashComputeStores(bo.GetCtx(), c.stores) if err == nil { - c.setTiflashComputeStores(stores) + c.stores.setTiflashComputeStores(stores) } return stores, err } @@ -2266,7 +2246,7 @@ func (c *RegionCache) InvalidateTiFlashComputeStoresIfGRPCError(err error) bool // InvalidateTiFlashComputeStores set needReload be true, // and will refresh tiflash_compute store cache next time. func (c *RegionCache) InvalidateTiFlashComputeStores() { - c.markTiflashComputeStoresNeedReload() + c.stores.markTiflashComputeStoresNeedReload() } // UpdateBucketsIfNeeded queries PD to update the buckets of the region in the cache if @@ -2652,7 +2632,7 @@ func (c *RegionCache) checkAndUpdateStoreHealthStatus() { }() healthDetails := make(map[uint64]HealthStatusDetail) now := time.Now() - c.forEachStore(func(store *Store) { + c.stores.forEach(func(store *Store) { store.healthStatus.tick(now) healthDetails[store.storeID] = store.healthStatus.GetHealthStatusDetail() }) @@ -2664,7 +2644,7 @@ func (c *RegionCache) checkAndUpdateStoreHealthStatus() { // reportStoreReplicaFlows reports the statistics on the related replicaFlowsType. func (c *RegionCache) reportStoreReplicaFlows() { - c.forEachStore(func(store *Store) { + c.stores.forEach(func(store *Store) { for destType := toLeader; destType < numReplicaFlowsType; destType++ { metrics.TiKVPreferLeaderFlowsGauge.WithLabelValues(destType.String(), store.addr).Set(float64(store.getReplicaFlowsStats(destType))) store.resetReplicaFlowsStats(destType) @@ -2683,7 +2663,7 @@ func contains(startKey, endKey, key []byte) bool { } func (c *RegionCache) onHealthFeedback(feedback *tikvpb.HealthFeedback) { - store, ok := c.getStore(feedback.GetStoreId()) + store, ok := c.stores.get(feedback.GetStoreId()) if !ok { logutil.BgLogger().Info("dropped health feedback info due to unknown store id", zap.Uint64("storeID", feedback.GetStoreId())) return diff --git a/internal/locate/region_cache_test.go b/internal/locate/region_cache_test.go index 8bffee0c86..544302cae6 100644 --- a/internal/locate/region_cache_test.go +++ b/internal/locate/region_cache_test.go @@ -331,8 +331,8 @@ func (s *testRegionCacheSuite) TestStoreLabels() { } for _, testcase := range testcases { s.T().Log(testcase.storeID) - store := s.cache.getStoreOrInsertDefault(testcase.storeID) - _, err := store.initResolve(s.bo, s.cache) + store := s.cache.stores.getOrInsertDefault(testcase.storeID) + _, err := store.initResolve(s.bo, s.cache.stores) s.Nil(err) labels := []*metapb.StoreLabel{ { @@ -340,7 +340,7 @@ func (s *testRegionCacheSuite) TestStoreLabels() { Value: fmt.Sprintf("%v", testcase.storeID), }, } - stores := s.cache.filterStores(nil, func(s *Store) bool { return s.IsLabelsMatch(labels) }) + stores := s.cache.stores.filter(nil, func(s *Store) bool { return s.IsLabelsMatch(labels) }) s.Equal(len(stores), 1) s.Equal(stores[0].labels, labels) } @@ -372,9 +372,9 @@ func (s *testRegionCacheSuite) TestResolveStateTransition() { // Check resolving normal stores. The resolve state should be resolved. for _, storeMeta := range s.cluster.GetAllStores() { - store := cache.getStoreOrInsertDefault(storeMeta.GetId()) + store := cache.stores.getOrInsertDefault(storeMeta.GetId()) s.Equal(store.getResolveState(), unresolved) - addr, err := store.initResolve(bo, cache) + addr, err := store.initResolve(bo, cache.stores) s.Nil(err) s.Equal(addr, storeMeta.GetAddress()) s.Equal(store.getResolveState(), resolved) @@ -390,26 +390,26 @@ func (s *testRegionCacheSuite) TestResolveStateTransition() { } // Mark the store needCheck. The resolve state should be resolved soon. - store := cache.getStoreOrInsertDefault(s.store1) - cache.markStoreNeedCheck(store) + store := cache.stores.getOrInsertDefault(s.store1) + cache.stores.markStoreNeedCheck(store) waitResolve(store) s.Equal(store.getResolveState(), resolved) // Mark the store needCheck and it becomes a tombstone. The resolve state should be tombstone. s.cluster.MarkTombstone(s.store1) - cache.markStoreNeedCheck(store) + cache.stores.markStoreNeedCheck(store) waitResolve(store) s.Equal(store.getResolveState(), tombstone) s.cluster.StartStore(s.store1) // Mark the store needCheck and it's deleted from PD. The resolve state should be tombstone. cache.clear() - store = cache.getStoreOrInsertDefault(s.store1) - store.initResolve(bo, cache) + store = cache.stores.getOrInsertDefault(s.store1) + store.initResolve(bo, cache.stores) s.Equal(store.getResolveState(), resolved) storeMeta := s.cluster.GetStore(s.store1) s.cluster.RemoveStore(s.store1) - cache.markStoreNeedCheck(store) + cache.stores.markStoreNeedCheck(store) waitResolve(store) s.Equal(store.getResolveState(), tombstone) s.cluster.AddStore(storeMeta.GetId(), storeMeta.GetAddress(), storeMeta.GetLabels()...) @@ -417,14 +417,14 @@ func (s *testRegionCacheSuite) TestResolveStateTransition() { // Mark the store needCheck and its address and labels are changed. // The resolve state should be deleted and a new store is added to the cache. cache.clear() - store = cache.getStoreOrInsertDefault(s.store1) - store.initResolve(bo, cache) + store = cache.stores.getOrInsertDefault(s.store1) + store.initResolve(bo, cache.stores) s.Equal(store.getResolveState(), resolved) s.cluster.UpdateStoreAddr(s.store1, store.addr+"0", &metapb.StoreLabel{Key: "k", Value: "v"}) - cache.markStoreNeedCheck(store) + cache.stores.markStoreNeedCheck(store) waitResolve(store) s.Equal(store.getResolveState(), deleted) - newStore := cache.getStoreOrInsertDefault(s.store1) + newStore := cache.stores.getOrInsertDefault(s.store1) s.Equal(newStore.getResolveState(), resolved) s.Equal(newStore.addr, store.addr+"0") s.Equal(newStore.labels, []*metapb.StoreLabel{{Key: "k", Value: "v"}}) @@ -432,9 +432,9 @@ func (s *testRegionCacheSuite) TestResolveStateTransition() { // Check initResolve()ing a tombstone store. The resolve state should be tombstone. cache.clear() s.cluster.MarkTombstone(s.store1) - store = cache.getStoreOrInsertDefault(s.store1) + store = cache.stores.getOrInsertDefault(s.store1) for i := 0; i < 2; i++ { - addr, err := store.initResolve(bo, cache) + addr, err := store.initResolve(bo, cache.stores) s.Nil(err) s.Equal(addr, "") s.Equal(store.getResolveState(), tombstone) @@ -446,9 +446,9 @@ func (s *testRegionCacheSuite) TestResolveStateTransition() { cache.clear() storeMeta = s.cluster.GetStore(s.store1) s.cluster.RemoveStore(s.store1) - store = cache.getStoreOrInsertDefault(s.store1) + store = cache.stores.getOrInsertDefault(s.store1) for i := 0; i < 2; i++ { - addr, err := store.initResolve(bo, cache) + addr, err := store.initResolve(bo, cache.stores) s.Nil(err) s.Equal(addr, "") s.Equal(store.getResolveState(), tombstone) @@ -485,7 +485,7 @@ func (s *testRegionCacheSuite) TestNeedExpireRegionAfterTTL() { s.Run("WithStaleStores", func() { cntGetRegion = 0 s.cache.clear() - store2 := s.cache.getStoreOrInsertDefault(s.store2) + store2 := s.cache.stores.getOrInsertDefault(s.store2) for i := 0; i < 50; i++ { atomic.StoreUint32(&store2.epoch, uint32(i)) @@ -499,7 +499,7 @@ func (s *testRegionCacheSuite) TestNeedExpireRegionAfterTTL() { s.Run("WithUnreachableStores", func() { cntGetRegion = 0 s.cache.clear() - store2 := s.cache.getStoreOrInsertDefault(s.store2) + store2 := s.cache.stores.getOrInsertDefault(s.store2) atomic.StoreUint32(&store2.livenessState, uint32(unreachable)) defer atomic.StoreUint32(&store2.livenessState, uint32(reachable)) @@ -1774,7 +1774,7 @@ func (s *testRegionCacheSuite) TestBuckets() { newMeta := proto.Clone(cachedRegion.meta).(*metapb.Region) newMeta.RegionEpoch.Version++ newMeta.RegionEpoch.ConfVer++ - _, err = s.cache.OnRegionEpochNotMatch(s.bo, &RPCContext{Region: cachedRegion.VerID(), Store: s.cache.getStoreOrInsertDefault(s.store1)}, []*metapb.Region{newMeta}) + _, err = s.cache.OnRegionEpochNotMatch(s.bo, &RPCContext{Region: cachedRegion.VerID(), Store: s.cache.stores.getOrInsertDefault(s.store1)}, []*metapb.Region{newMeta}) s.Nil(err) cachedRegion = s.getRegion([]byte("a")) s.Equal(newBuckets, cachedRegion.getStore().buckets) @@ -2049,13 +2049,13 @@ func (s *testRegionCacheSuite) TestHealthCheckWithStoreReplace() { // init region cache s.cache.LocateKey(s.bo, []byte("a")) - store1, _ := s.cache.getStore(s.store1) + store1, _ := s.cache.stores.get(s.store1) s.Require().NotNil(store1) s.Require().Equal(resolved, store1.getResolveState()) // setup mock liveness func store1Liveness := uint32(unreachable) - s.cache.setMockRequestLiveness(func(ctx context.Context, s *Store) livenessState { + s.cache.stores.setMockRequestLiveness(func(ctx context.Context, s *Store) livenessState { if s.storeID == store1.storeID { return livenessState(atomic.LoadUint32(&store1Liveness)) } @@ -2064,7 +2064,7 @@ func (s *testRegionCacheSuite) TestHealthCheckWithStoreReplace() { // start health check loop atomic.StoreUint32(&store1.livenessState, store1Liveness) - startHealthCheckLoop(s.cache, store1, livenessState(store1Liveness), time.Second) + startHealthCheckLoop(s.cache.bg, s.cache.stores, store1, livenessState(store1Liveness), time.Second) // update store meta s.cluster.UpdateStoreAddr(store1.storeID, store1.addr+"'", store1.labels...) @@ -2075,7 +2075,7 @@ func (s *testRegionCacheSuite) TestHealthCheckWithStoreReplace() { }, 3*time.Second, time.Second) // assert that the new store should be added and it's also not reachable - newStore1, _ := s.cache.getStore(store1.storeID) + newStore1, _ := s.cache.stores.get(store1.storeID) s.Require().NotEqual(reachable, newStore1.getLivenessState()) // recover store1 @@ -2156,7 +2156,7 @@ func (s *testRegionCacheSuite) TestRegionCacheHandleHealthStatus() { _, err := s.cache.LocateKey(s.bo, []byte("k")) s.Nil(err) - store1, exists := s.cache.getStore(s.store1) + store1, exists := s.cache.stores.get(s.store1) s.True(exists) s.False(store1.healthStatus.IsSlow()) @@ -2197,7 +2197,7 @@ func (s *testRegionCacheSuite) TestRegionCacheHandleHealthStatus() { s.False(store1.healthStatus.IsSlow()) s.Equal(int64(50), store1.healthStatus.GetHealthStatusDetail().TiKVSideSlowScore) - store2, exists := s.cache.getStore(s.store2) + store2, exists := s.cache.stores.get(s.store2) s.True(exists) // Store 2 is never affected by updating store 1 s.LessOrEqual(store2.healthStatus.GetHealthStatusDetail().TiKVSideSlowScore, int64(1)) diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index d84711fb63..77b22c50e9 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -1273,7 +1273,7 @@ func (s *baseReplicaSelector) getBaseReplicaSelector() *baseReplicaSelector { } func (s *baseReplicaSelector) checkLiveness(bo *retry.Backoffer, accessReplica *replica) livenessState { - return accessReplica.store.requestLivenessAndStartHealthCheckLoopIfNeeded(bo, s.regionCache) + return accessReplica.store.requestLivenessAndStartHealthCheckLoopIfNeeded(bo, s.regionCache.bg, s.regionCache.stores) } func (s *baseReplicaSelector) invalidateReplicaStore(replica *replica, cause error) { @@ -1287,7 +1287,7 @@ func (s *baseReplicaSelector) invalidateReplicaStore(replica *replica, cause err ) metrics.RegionCacheCounterWithInvalidateStoreRegionsOK.Inc() // schedule a store addr resolve. - s.regionCache.markStoreNeedCheck(store) + s.regionCache.stores.markStoreNeedCheck(store) store.healthStatus.markAlreadySlow() } } @@ -2329,7 +2329,7 @@ func (s *RegionRequestSender) onRegionError( zap.Stringer("storeNotMatch", storeNotMatch), zap.Stringer("ctx", ctx), ) - s.regionCache.markStoreNeedCheck(ctx.Store) + s.regionCache.stores.markStoreNeedCheck(ctx.Store) s.regionCache.InvalidateCachedRegion(ctx.Region) // It's possible the address of store is not changed but the DNS resolves to a different address in k8s environment, // so we always reconnect in this case. diff --git a/internal/locate/region_request3_test.go b/internal/locate/region_request3_test.go index b28fc34d05..32ed218d7b 100644 --- a/internal/locate/region_request3_test.go +++ b/internal/locate/region_request3_test.go @@ -110,7 +110,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestStoreTokenLimit() { s.NotNil(region) oldStoreLimit := kv.StoreLimit.Load() kv.StoreLimit.Store(500) - s.cache.getStoreOrInsertDefault(s.storeIDs[0]).tokenCount.Store(500) + s.cache.stores.getOrInsertDefault(s.storeIDs[0]).tokenCount.Store(500) // cause there is only one region in this cluster, regionID maps this leader. resp, _, err := s.regionRequestSender.SendReq(s.bo, req, region.Region, time.Second) s.NotNil(err) @@ -256,7 +256,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestForwarding() { return innerClient.SendRequest(ctx, addr, req, timeout) }} var storeState = uint32(unreachable) - sender.regionCache.setMockRequestLiveness(func(ctx context.Context, s *Store) livenessState { + sender.regionCache.stores.setMockRequestLiveness(func(ctx context.Context, s *Store) livenessState { if s.addr == leaderAddr { return livenessState(atomic.LoadUint32(&storeState)) } @@ -536,7 +536,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestReplicaSelector() { replicaSelector, err = newReplicaSelector(cache, regionLoc.Region, req) s.Nil(err) s.NotNil(replicaSelector) - unreachable.injectConstantLiveness(cache) + unreachable.injectConstantLiveness(cache.stores) s.IsType(&accessKnownLeader{}, replicaSelector.state) _, err = replicaSelector.next(s.bo, req) s.Nil(err) @@ -572,7 +572,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestReplicaSelector() { // Do not try to use proxy if livenessState is unknown instead of unreachable. refreshEpochs(regionStore) cache.enableForwarding = true - unknown.injectConstantLiveness(cache) + unknown.injectConstantLiveness(cache.stores) replicaSelector, err = newReplicaSelector(cache, regionLoc.Region, req) s.Nil(err) s.NotNil(replicaSelector) @@ -594,7 +594,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestReplicaSelector() { replicaSelector, err = newReplicaSelector(cache, regionLoc.Region, req) s.Nil(err) s.NotNil(replicaSelector) - unreachable.injectConstantLiveness(cache) + unreachable.injectConstantLiveness(cache.stores) s.Eventually(func() bool { return regionStore.stores[regionStore.workTiKVIdx].getLivenessState() == unreachable }, 3*time.Second, 200*time.Millisecond) @@ -878,7 +878,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqWithReplicaSelector() { } return nil } - reachable.injectConstantLiveness(s.cache) + reachable.injectConstantLiveness(s.cache.stores) s.Eventually(func() bool { stores := getReplicaSelectorRegionStores() return stores[0].getLivenessState() == reachable && @@ -1004,7 +1004,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqWithReplicaSelector() { } // Runs out of all replicas and then returns a send error. - unreachable.injectConstantLiveness(s.cache) + unreachable.injectConstantLiveness(s.cache.stores) reloadRegion() for _, store := range s.storeIDs { s.cluster.StopStore(store) @@ -1292,7 +1292,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqFirstTimeout() { } // Test for write request. - reachable.injectConstantLiveness(s.cache) + reachable.injectConstantLiveness(s.cache.stores) resetStats() req := tikvrpc.NewRequest(tikvrpc.CmdPrewrite, &kvrpcpb.PrewriteRequest{}, kvrpcpb.Context{}) req.ReplicaReadType = kv.ReplicaReadLeader diff --git a/internal/locate/region_request_state_test.go b/internal/locate/region_request_state_test.go index ac6dd20011..022fb13a62 100644 --- a/internal/locate/region_request_state_test.go +++ b/internal/locate/region_request_state_test.go @@ -85,7 +85,7 @@ func (s *testRegionCacheStaleReadSuite) SetupTest() { } func (s *testRegionCacheStaleReadSuite) TearDownTest() { - s.cache.setMockRequestLiveness(nil) + s.cache.stores.setMockRequestLiveness(nil) s.cache.Close() s.mvccStore.Close() } @@ -223,7 +223,7 @@ func (s *testRegionCacheStaleReadSuite) setClient() { return }} - s.cache.setMockRequestLiveness(func(ctx context.Context, store *Store) livenessState { + s.cache.stores.setMockRequestLiveness(func(ctx context.Context, store *Store) livenessState { _, ok := s.injection.unavailableStoreIDs[store.storeID] if ok { return unreachable diff --git a/internal/locate/region_request_test.go b/internal/locate/region_request_test.go index 1ab228ca0a..a86de2a121 100644 --- a/internal/locate/region_request_test.go +++ b/internal/locate/region_request_test.go @@ -765,7 +765,7 @@ func (s *testRegionRequestToSingleStoreSuite) TestBatchClientSendLoopPanic() { }() req := tikvrpc.NewRequest(tikvrpc.CmdCop, &coprocessor.Request{Data: []byte("a"), StartTs: 1}) regionRequestSender := NewRegionRequestSender(s.cache, fnClient) - reachable.injectConstantLiveness(regionRequestSender.regionCache) + reachable.injectConstantLiveness(regionRequestSender.regionCache.stores) regionRequestSender.SendReq(bo, req, region.Region, client.ReadTimeoutShort) } }() diff --git a/internal/locate/replica_selector_test.go b/internal/locate/replica_selector_test.go index 97b7e52bcc..bd73bd8be1 100644 --- a/internal/locate/replica_selector_test.go +++ b/internal/locate/replica_selector_test.go @@ -2589,7 +2589,7 @@ func TestReplicaReadAvoidSlowStore(t *testing.T) { defer s.TearDownTest() s.changeRegionLeader(3) - store, exists := s.cache.getStore(1) + store, exists := s.cache.stores.get(1) s.True(exists) for _, staleRead := range []bool{false, true} { @@ -3056,7 +3056,7 @@ func (ca *replicaSelectorAccessPathCase) genAccessErr(regionCache *RegionCache, } if err != nil { // inject unreachable liveness. - unreachable.injectConstantLiveness(regionCache) + unreachable.injectConstantLiveness(regionCache.stores) } return regionErr, err } @@ -3094,7 +3094,7 @@ func (c *replicaSelectorAccessPathCase) Format() string { func (s *testReplicaSelectorSuite) resetStoreState() { // reset slow score, since serverIsBusyErr will mark the store is slow, and affect remaining test cases. - reachable.injectConstantLiveness(s.cache) // inject reachable liveness. + reachable.injectConstantLiveness(s.cache.stores) // inject reachable liveness. rc := s.getRegion() s.NotNil(rc) for _, store := range rc.getStore().stores { diff --git a/internal/locate/store_cache.go b/internal/locate/store_cache.go index 94ea5bfedb..c8af9e0e86 100644 --- a/internal/locate/store_cache.go +++ b/internal/locate/store_cache.go @@ -32,6 +32,7 @@ import ( "github.com/tikv/client-go/v2/metrics" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/util" + pd "github.com/tikv/pd/client" "go.uber.org/zap" "golang.org/x/sync/singleflight" "google.golang.org/grpc" @@ -47,7 +48,59 @@ type testingKnobs interface { setMockRequestLiveness(f livenessFunc) } -func (c *RegionCache) getMockRequestLiveness() livenessFunc { +type storeRegistry interface { + fetchStore(ctx context.Context, id uint64) (*metapb.Store, error) + fetchAllStores(ctx context.Context) ([]*metapb.Store, error) +} + +type storeCache interface { + testingKnobs + storeRegistry + get(id uint64) (store *Store, exists bool) + getOrInsertDefault(id uint64) *Store + put(store *Store) + clear() + forEach(f func(*Store)) + filter(dst []*Store, predicate func(*Store) bool) []*Store + listTiflashComputeStores() (stores []*Store, needReload bool) + setTiflashComputeStores(stores []*Store) + markTiflashComputeStoresNeedReload() + markStoreNeedCheck(store *Store) + getCheckStoreEvents() <-chan struct{} +} + +func newStoreCache(pdClient pd.Client) *storeCacheImpl { + c := &storeCacheImpl{pdClient: pdClient} + c.notifyCheckCh = make(chan struct{}, 1) + c.storeMu.stores = make(map[uint64]*Store) + c.tiflashComputeStoreMu.needReload = true + c.tiflashComputeStoreMu.stores = make([]*Store, 0) + return c +} + +type storeCacheImpl struct { + pdClient pd.Client + + testingKnobs struct { + // Replace the requestLiveness function for test purpose. Note that in unit tests, if this is not set, + // requestLiveness always returns unreachable. + mockRequestLiveness atomic.Pointer[livenessFunc] + } + + notifyCheckCh chan struct{} + storeMu struct { + sync.RWMutex + stores map[uint64]*Store + } + + tiflashComputeStoreMu struct { + sync.RWMutex + needReload bool + stores []*Store + } +} + +func (c *storeCacheImpl) getMockRequestLiveness() livenessFunc { f := c.testingKnobs.mockRequestLiveness.Load() if f == nil { return nil @@ -55,46 +108,26 @@ func (c *RegionCache) getMockRequestLiveness() livenessFunc { return *f } -func (c *RegionCache) setMockRequestLiveness(f livenessFunc) { +func (c *storeCacheImpl) setMockRequestLiveness(f livenessFunc) { c.testingKnobs.mockRequestLiveness.Store(&f) } -type storeRegistry interface { - fetchStore(ctx context.Context, id uint64) (*metapb.Store, error) - fetchAllStores(ctx context.Context) ([]*metapb.Store, error) -} - -func (c *RegionCache) fetchStore(ctx context.Context, id uint64) (*metapb.Store, error) { +func (c *storeCacheImpl) fetchStore(ctx context.Context, id uint64) (*metapb.Store, error) { return c.pdClient.GetStore(ctx, id) } -func (c *RegionCache) fetchAllStores(ctx context.Context) ([]*metapb.Store, error) { +func (c *storeCacheImpl) fetchAllStores(ctx context.Context) ([]*metapb.Store, error) { return c.pdClient.GetAllStores(ctx) } -type storeCache interface { - storeRegistry - getStore(id uint64) (store *Store, exists bool) - getStoreOrInsertDefault(id uint64) *Store - putStore(store *Store) - clearStores() - forEachStore(f func(*Store)) - filterStores(dst []*Store, predicate func(*Store) bool) []*Store - listTiflashComputeStores() (stores []*Store, needReload bool) - setTiflashComputeStores(stores []*Store) - markTiflashComputeStoresNeedReload() - markStoreNeedCheck(store *Store) - getCheckStoreEvents() <-chan struct{} -} - -func (c *RegionCache) getStore(id uint64) (store *Store, exists bool) { +func (c *storeCacheImpl) get(id uint64) (store *Store, exists bool) { c.storeMu.RLock() store, exists = c.storeMu.stores[id] c.storeMu.RUnlock() return } -func (c *RegionCache) getStoreOrInsertDefault(id uint64) *Store { +func (c *storeCacheImpl) getOrInsertDefault(id uint64) *Store { c.storeMu.Lock() store, exists := c.storeMu.stores[id] if !exists { @@ -105,19 +138,19 @@ func (c *RegionCache) getStoreOrInsertDefault(id uint64) *Store { return store } -func (c *RegionCache) putStore(store *Store) { +func (c *storeCacheImpl) put(store *Store) { c.storeMu.Lock() c.storeMu.stores[store.storeID] = store c.storeMu.Unlock() } -func (c *RegionCache) clearStores() { +func (c *storeCacheImpl) clear() { c.storeMu.Lock() c.storeMu.stores = make(map[uint64]*Store) c.storeMu.Unlock() } -func (c *RegionCache) forEachStore(f func(*Store)) { +func (c *storeCacheImpl) forEach(f func(*Store)) { c.storeMu.RLock() defer c.storeMu.RUnlock() for _, s := range c.storeMu.stores { @@ -125,7 +158,7 @@ func (c *RegionCache) forEachStore(f func(*Store)) { } } -func (c *RegionCache) filterStores(dst []*Store, predicate func(*Store) bool) []*Store { +func (c *storeCacheImpl) filter(dst []*Store, predicate func(*Store) bool) []*Store { c.storeMu.RLock() for _, store := range c.storeMu.stores { if predicate == nil || predicate(store) { @@ -136,7 +169,7 @@ func (c *RegionCache) filterStores(dst []*Store, predicate func(*Store) bool) [] return dst } -func (c *RegionCache) listTiflashComputeStores() (stores []*Store, needReload bool) { +func (c *storeCacheImpl) listTiflashComputeStores() (stores []*Store, needReload bool) { c.tiflashComputeStoreMu.RLock() needReload = c.tiflashComputeStoreMu.needReload stores = c.tiflashComputeStoreMu.stores @@ -144,20 +177,20 @@ func (c *RegionCache) listTiflashComputeStores() (stores []*Store, needReload bo return } -func (c *RegionCache) setTiflashComputeStores(stores []*Store) { +func (c *storeCacheImpl) setTiflashComputeStores(stores []*Store) { c.tiflashComputeStoreMu.Lock() c.tiflashComputeStoreMu.stores = stores c.tiflashComputeStoreMu.needReload = false c.tiflashComputeStoreMu.Unlock() } -func (c *RegionCache) markTiflashComputeStoresNeedReload() { +func (c *storeCacheImpl) markTiflashComputeStoresNeedReload() { c.tiflashComputeStoreMu.Lock() c.tiflashComputeStoreMu.needReload = true c.tiflashComputeStoreMu.Unlock() } -func (c *RegionCache) markStoreNeedCheck(store *Store) { +func (c *storeCacheImpl) markStoreNeedCheck(store *Store) { if store.changeResolveStateTo(resolved, needCheck) { select { case c.notifyCheckCh <- struct{}{}: @@ -166,7 +199,7 @@ func (c *RegionCache) markStoreNeedCheck(store *Store) { } } -func (c *RegionCache) getCheckStoreEvents() <-chan struct{} { +func (c *storeCacheImpl) getCheckStoreEvents() <-chan struct{} { return c.notifyCheckCh } @@ -435,7 +468,7 @@ func (s *Store) reResolve(c storeCache) (bool, error) { if s.addr == addr { newStore.healthStatus = s.healthStatus } - c.putStore(newStore) + c.put(newStore) s.setResolveState(deleted) return false, nil } @@ -536,7 +569,7 @@ func (s *Store) getLivenessState() livenessState { return livenessState(atomic.LoadUint32(&s.livenessState)) } -func (s *Store) requestLivenessAndStartHealthCheckLoopIfNeeded(bo *retry.Backoffer, c *RegionCache) (liveness livenessState) { +func (s *Store) requestLivenessAndStartHealthCheckLoopIfNeeded(bo *retry.Backoffer, scheduler *bgRunner, c storeCache) (liveness livenessState) { liveness = requestLiveness(bo.GetCtx(), s, c) if liveness == reachable { return @@ -560,15 +593,15 @@ func (s *Store) requestLivenessAndStartHealthCheckLoopIfNeeded(bo *retry.Backoff if _, err := util.EvalFailpoint("skipStoreCheckUntilHealth"); err == nil { return } - startHealthCheckLoop(c, s, liveness, reResolveInterval) + startHealthCheckLoop(scheduler, c, s, liveness, reResolveInterval) } return } -func startHealthCheckLoop(c *RegionCache, s *Store, liveness livenessState, reResolveInterval time.Duration) { +func startHealthCheckLoop(scheduler *bgRunner, c storeCache, s *Store, liveness livenessState, reResolveInterval time.Duration) { lastCheckPDTime := time.Now() - c.bg.schedule(func(ctx context.Context, t time.Time) bool { + scheduler.schedule(func(ctx context.Context, t time.Time) bool { if t.Sub(lastCheckPDTime) > reResolveInterval { lastCheckPDTime = t @@ -584,7 +617,7 @@ func startHealthCheckLoop(c *RegionCache, s *Store, liveness livenessState, reRe return true } // if the store is deleted, a new store with same id must be inserted (guaranteed by reResolve). - newStore, _ := c.getStore(s.storeID) + newStore, _ := c.get(s.storeID) logutil.BgLogger().Info("[health check] store meta changed", zap.Uint64("storeID", s.storeID), zap.String("oldAddr", s.addr), From cf37e5e03e439b78c14dde45b66c0c2fc1bd2d3e Mon Sep 17 00:00:00 2001 From: crazycs Date: Fri, 19 Apr 2024 15:24:53 +0800 Subject: [PATCH 05/22] skip TestReplicaReadAccessPathByGenError because it's unstable and slow (#1302) Signed-off-by: crazycs520 --- internal/locate/replica_selector_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/locate/replica_selector_test.go b/internal/locate/replica_selector_test.go index bd73bd8be1..1de2e43a56 100644 --- a/internal/locate/replica_selector_test.go +++ b/internal/locate/replica_selector_test.go @@ -2737,6 +2737,7 @@ func TestReplicaReadAvoidSlowStore(t *testing.T) { } func TestReplicaReadAccessPathByGenError(t *testing.T) { + t.Skip("skip TestReplicaReadAccessPathByGenError because it's unstable and slow.") s := new(testReplicaSelectorSuite) s.SetupTest(t) defer func(lv zapcore.Level) { From 059938f7eb51996903527d3b2de22d43695734d3 Mon Sep 17 00:00:00 2001 From: crazycs Date: Fri, 19 Apr 2024 17:26:33 +0800 Subject: [PATCH 06/22] reduce log (#1304) Signed-off-by: crazycs520 --- internal/locate/region_request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index 77b22c50e9..be3103d055 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -2396,7 +2396,7 @@ func (s *RegionRequestSender) onRegionError( // This error is specific to stale read and the target replica is randomly selected. If the request is sent // to the leader, the data must be ready, so we don't backoff here. if regionErr.GetDataIsNotReady() != nil { - logutil.Logger(bo.GetCtx()).Warn( + logutil.Logger(bo.GetCtx()).Debug( "tikv reports `DataIsNotReady` retry later", zap.Uint64("store-id", ctx.Store.storeID), zap.Uint64("peer-id", regionErr.GetDataIsNotReady().GetPeerId()), From edba2544d5dcbe0cf6f8679bddabd321752debdc Mon Sep 17 00:00:00 2001 From: you06 Date: Tue, 23 Apr 2024 18:36:44 +0900 Subject: [PATCH 07/22] txn: abort pipelined dml when pk rollback (#1317) * fail p-dml when ttl manager is closed Signed-off-by: you06 * close ttl manager when pk is rollbcked Signed-off-by: you06 * stablize test Signed-off-by: you06 * add test Signed-off-by: you06 * fix race Signed-off-by: you06 * fix leak in test Signed-off-by: you06 * remote testlog Signed-off-by: you06 * check error message Signed-off-by: you06 --------- Signed-off-by: you06 --- integration_tests/pipelined_memdb_test.go | 65 +++++++++++++++++++++ internal/unionstore/pipelined_memdb_test.go | 4 +- tikv/test_probe.go | 4 +- txnkv/transaction/2pc.go | 11 +++- txnkv/transaction/txn.go | 3 + 5 files changed, 81 insertions(+), 6 deletions(-) diff --git a/integration_tests/pipelined_memdb_test.go b/integration_tests/pipelined_memdb_test.go index ac38d59dc5..3d6c2b4790 100644 --- a/integration_tests/pipelined_memdb_test.go +++ b/integration_tests/pipelined_memdb_test.go @@ -18,6 +18,7 @@ import ( "bytes" "context" "strconv" + "sync/atomic" "testing" "time" @@ -27,10 +28,13 @@ import ( "github.com/stretchr/testify/suite" "github.com/tikv/client-go/v2/config/retry" tikverr "github.com/tikv/client-go/v2/error" + "github.com/tikv/client-go/v2/oracle" "github.com/tikv/client-go/v2/testutils" "github.com/tikv/client-go/v2/tikv" "github.com/tikv/client-go/v2/tikvrpc" + "github.com/tikv/client-go/v2/txnkv" "github.com/tikv/client-go/v2/txnkv/transaction" + "github.com/tikv/client-go/v2/txnkv/txnlock" "github.com/tikv/client-go/v2/txnkv/txnsnapshot" ) @@ -70,6 +74,26 @@ func (s *testPipelinedMemDBSuite) TearDownTest() { s.store.Close() } +func (s *testPipelinedMemDBSuite) mustGetLock(key []byte) *txnkv.Lock { + ver, err := s.store.CurrentTimestamp(oracle.GlobalTxnScope) + s.Nil(err) + bo := tikv.NewBackofferWithVars(context.Background(), getMaxBackoff, nil) + req := tikvrpc.NewRequest(tikvrpc.CmdGet, &kvrpcpb.GetRequest{ + Key: key, + Version: ver, + }) + loc, err := s.store.GetRegionCache().LocateKey(bo, key) + s.Nil(err) + resp, err := s.store.SendReq(bo, req, loc.Region, tikv.ReadTimeoutShort) + s.Nil(err) + s.NotNil(resp.Resp) + keyErr := resp.Resp.(*kvrpcpb.GetResponse).GetError() + s.NotNil(keyErr) + lock, err := txnlock.ExtractLockFromKeyErr(keyErr) + s.Nil(err) + return lock +} + func (s *testPipelinedMemDBSuite) TestPipelinedAndFlush() { ctx := context.Background() txn, err := s.store.Begin(tikv.WithPipelinedMemDB()) @@ -163,6 +187,7 @@ func (s *testPipelinedMemDBSuite) TestPipelinedFlushBlock() { s.Nil(failpoint.Disable("tikvclient/beforePipelinedFlush")) <-flushReturned s.Nil(txn.GetMemBuffer().FlushWait()) + s.Nil(txn.Rollback()) } func (s *testPipelinedMemDBSuite) TestPipelinedSkipFlushedLock() { @@ -401,3 +426,43 @@ func (s *testPipelinedMemDBSuite) TestPipelinedPrefetch() { s.True(tikverr.IsErrNotFound(err)) txn.Rollback() } + +func (s *testPipelinedMemDBSuite) TestPipelinedDMLFailedByPKRollback() { + originManageTTLVal := atomic.LoadUint64(&transaction.ManagedLockTTL) + atomic.StoreUint64(&transaction.ManagedLockTTL, 100) // set to 100ms + defer atomic.StoreUint64(&transaction.ManagedLockTTL, originManageTTLVal) + + txn, err := s.store.Begin(tikv.WithPipelinedMemDB()) + s.Nil(err) + txn.Set([]byte("key1"), []byte("value1")) + txnProbe := transaction.TxnProbe{KVTxn: txn} + flushed, err := txnProbe.GetMemBuffer().Flush(true) + s.Nil(err) + s.True(flushed) + s.Nil(txn.GetMemBuffer().FlushWait()) + s.Equal(txnProbe.GetCommitter().GetPrimaryKey(), []byte("key1")) + + s.True(txnProbe.GetCommitter().IsTTLRunning()) + + // resolve the primary lock + locks := []*txnlock.Lock{s.mustGetLock([]byte("key1"))} + lr := s.store.GetLockResolver() + bo := tikv.NewGcResolveLockMaxBackoffer(context.Background()) + loc, err := s.store.GetRegionCache().LocateKey(bo, locks[0].Primary) + s.Nil(err) + success, err := lr.BatchResolveLocks(bo, locks, loc.Region) + s.True(success) + s.Nil(err) + + s.Eventuallyf(func() bool { + return !txnProbe.GetCommitter().IsTTLRunning() + }, 5*time.Second, 100*time.Millisecond, "ttl manager should stop after primary lock is resolved") + + txn.Set([]byte("key2"), []byte("value2")) + flushed, err = txn.GetMemBuffer().Flush(true) + s.Nil(err) + s.True(flushed) + err = txn.GetMemBuffer().FlushWait() + s.NotNil(err) + s.ErrorContains(err, "ttl manager is closed") +} diff --git a/internal/unionstore/pipelined_memdb_test.go b/internal/unionstore/pipelined_memdb_test.go index 745489f5b1..4bbf6846e6 100644 --- a/internal/unionstore/pipelined_memdb_test.go +++ b/internal/unionstore/pipelined_memdb_test.go @@ -63,7 +63,7 @@ func TestPipelinedFlushTrigger(t *testing.T) { }) for i := 0; i < MinFlushKeys-1; i++ { key := []byte(strconv.Itoa(i)) - value := make([]byte, avgKeySize-len(key)+1) + value := make([]byte, avgKeySize*2-len(key)+1) // (key + value) * (MinFLushKeys - 1) > MinFlushMemSize memdb.Set(key, value) flushed, err := memdb.Flush(false) @@ -82,7 +82,7 @@ func TestPipelinedFlushTrigger(t *testing.T) { }) for i := 0; i < MinFlushKeys; i++ { key := []byte(strconv.Itoa(i)) - value := make([]byte, avgKeySize-len(key)+1) // (key + value) * MinFLushKeys > MinFlushKeys + value := make([]byte, avgKeySize*2-len(key)+1) // (key + value) * MinFLushKeys > MinFlushKeys memdb.Set(key, value) flushed, err := memdb.Flush(false) require.Nil(t, err) diff --git a/tikv/test_probe.go b/tikv/test_probe.go index 34fab5c35a..3686f67fc3 100644 --- a/tikv/test_probe.go +++ b/tikv/test_probe.go @@ -60,8 +60,8 @@ func (s StoreProbe) NewLockResolver() LockResolverProbe { } // Begin starts a transaction. -func (s StoreProbe) Begin() (transaction.TxnProbe, error) { - txn, err := s.KVStore.Begin() +func (s StoreProbe) Begin(opts ...TxnOption) (transaction.TxnProbe, error) { + txn, err := s.KVStore.Begin(opts...) return transaction.TxnProbe{KVTxn: txn}, err } diff --git a/txnkv/transaction/2pc.go b/txnkv/transaction/2pc.go index ddfe17ad3d..75741bfdc6 100644 --- a/txnkv/transaction/2pc.go +++ b/txnkv/transaction/2pc.go @@ -1158,7 +1158,7 @@ func (tm *ttlManager) run(c *twoPhaseCommitter, lockCtx *kv.LockCtx, isPipelined tm.ch = make(chan struct{}) tm.lockCtx = lockCtx - go keepAlive(c, tm.ch, c.primary(), lockCtx, isPipelinedTxn) + go keepAlive(c, tm.ch, tm, c.primary(), lockCtx, isPipelinedTxn) } func (tm *ttlManager) close() { @@ -1180,7 +1180,7 @@ const pessimisticLockMaxBackoff = 20000 const maxConsecutiveFailure = 10 func keepAlive( - c *twoPhaseCommitter, closeCh chan struct{}, primaryKey []byte, + c *twoPhaseCommitter, closeCh chan struct{}, tm *ttlManager, primaryKey []byte, lockCtx *kv.LockCtx, isPipelinedTxn bool, ) { // Ticker is set to 1/2 of the ManagedLockTTL. @@ -1193,6 +1193,7 @@ func keepAlive( keepFail := 0 for { select { + // because ttlManager can be reset, closeCh may not be equal to tm.ch. case <-closeCh: return case <-ticker.C: @@ -1254,6 +1255,12 @@ func keepAlive( zap.Uint64("txnStartTS", c.startTS), zap.Bool("isPipelinedTxn", isPipelinedTxn), ) + if isPipelinedTxn { + // pipelined DML cannot run without the ttlManager. + // Once the ttl manager fails, the transaction should be rolled back to avoid writing useless locks. + // close the ttlManager and the further flush will stop. + tm.close() + } return } continue diff --git a/txnkv/transaction/txn.go b/txnkv/transaction/txn.go index 28c712bce4..aea701f2df 100644 --- a/txnkv/transaction/txn.go +++ b/txnkv/transaction/txn.go @@ -467,6 +467,9 @@ func (txn *KVTxn) InitPipelinedMemDB() error { pipelinedMemDB := unionstore.NewPipelinedMemDB(func(ctx context.Context, keys [][]byte) (map[string][]byte, error) { return txn.snapshot.BatchGetWithTier(ctx, keys, txnsnapshot.BatchGetBufferTier) }, func(generation uint64, memdb *unionstore.MemDB) (err error) { + if atomic.LoadUint32((*uint32)(&txn.committer.ttlManager.state)) == uint32(stateClosed) { + return errors.New("ttl manager is closed") + } startTime := time.Now() defer func() { if err != nil { From 0229f4077f0c28adf6e6bbd3a3fe6d66c380c6c7 Mon Sep 17 00:00:00 2001 From: you06 Date: Wed, 24 Apr 2024 14:23:42 +0900 Subject: [PATCH 08/22] do not cache snapshot with version maxuint64 (#1320) Signed-off-by: you06 --- integration_tests/snapshot_test.go | 25 +++++++++++++++++++++++++ txnkv/txnsnapshot/snapshot.go | 5 +++++ 2 files changed, 30 insertions(+) diff --git a/integration_tests/snapshot_test.go b/integration_tests/snapshot_test.go index 2e19342d3a..a8244ed4fa 100644 --- a/integration_tests/snapshot_test.go +++ b/integration_tests/snapshot_test.go @@ -47,6 +47,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/suite" "github.com/tikv/client-go/v2/error" + "github.com/tikv/client-go/v2/oracle" "github.com/tikv/client-go/v2/tikv" "github.com/tikv/client-go/v2/tikvrpc" "github.com/tikv/client-go/v2/txnkv" @@ -395,3 +396,27 @@ func (s *testSnapshotSuite) TestRCRead() { s.deleteKeys(keys) } } + +func (s *testSnapshotSuite) TestSnapshotCacheBypassMaxUint64() { + txn := s.beginTxn() + s.Nil(txn.Set([]byte("x"), []byte("x"))) + s.Nil(txn.Set([]byte("y"), []byte("y"))) + s.Nil(txn.Set([]byte("z"), []byte("z"))) + s.Nil(txn.Commit(context.Background())) + // cache version < math.MaxUint64 + startTS, err := s.store.GetTimestampWithRetry(tikv.NewNoopBackoff(context.Background()), oracle.GlobalTxnScope) + s.Nil(err) + snapshot := s.store.GetSnapshot(startTS) + snapshot.Get(context.Background(), []byte("x")) + snapshot.BatchGet(context.Background(), [][]byte{[]byte("y"), []byte("z")}) + s.Equal(snapshot.SnapCache(), map[string][]byte{ + "x": []byte("x"), + "y": []byte("y"), + "z": []byte("z"), + }) + // not cache version == math.MaxUint64 + snapshot = s.store.GetSnapshot(math.MaxUint64) + snapshot.Get(context.Background(), []byte("x")) + snapshot.BatchGet(context.Background(), [][]byte{[]byte("y"), []byte("z")}) + s.Empty(snapshot.SnapCache()) +} diff --git a/txnkv/txnsnapshot/snapshot.go b/txnkv/txnsnapshot/snapshot.go index cb5b38b1f5..f40e6bc984 100644 --- a/txnkv/txnsnapshot/snapshot.go +++ b/txnkv/txnsnapshot/snapshot.go @@ -1007,6 +1007,11 @@ func (s *KVSnapshot) SnapCache() map[string][]byte { // UpdateSnapshotCache sets the values of cache, for further fast read with same keys. func (s *KVSnapshot) UpdateSnapshotCache(keys [][]byte, m map[string][]byte) { + // s.version == math.MaxUint64 is used in special transaction, which always read the latest data. + // do not cache it to avoid anomaly. + if s.version == math.MaxUint64 { + return + } s.mu.Lock() defer s.mu.Unlock() if s.mu.cached == nil { From 8635acc8400b52c9bd4d2ab562b7f9771fceae98 Mon Sep 17 00:00:00 2001 From: ekexium Date: Wed, 24 Apr 2024 19:16:26 +0800 Subject: [PATCH 09/22] feat: return error if commit ts expired is returned for a non-primary key (#1316) Signed-off-by: ekexium Co-authored-by: cfzjywxk --- txnkv/transaction/commit.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/txnkv/transaction/commit.go b/txnkv/transaction/commit.go index bf5302e698..a3b4be8108 100644 --- a/txnkv/transaction/commit.go +++ b/txnkv/transaction/commit.go @@ -35,6 +35,7 @@ package transaction import ( + "bytes" "encoding/hex" "time" @@ -158,7 +159,17 @@ func (action actionCommit) handleSingleBatch(c *twoPhaseCommitter, bo *retry.Bac if rejected := keyErr.GetCommitTsExpired(); rejected != nil { logutil.Logger(bo.GetCtx()).Info("2PC commitTS rejected by TiKV, retry with a newer commitTS", zap.Uint64("txnStartTS", c.startTS), - zap.Stringer("info", logutil.Hex(rejected))) + zap.Stringer("info", logutil.Hex(rejected)), + ) + + if !batch.isPrimary || !bytes.Equal(rejected.Key, c.primary()) { + logutil.Logger(bo.GetCtx()).Error("2PC commitTS rejected by TiKV, but the key is not the primary key", + zap.Uint64("txnStartTS", c.startTS), + zap.String("key", hex.EncodeToString(rejected.Key)), + zap.String("primary", hex.EncodeToString(c.primary())), + zap.Bool("batchIsPrimary", batch.isPrimary)) + return errors.New("2PC commitTS rejected by TiKV, but the key is not the primary key") + } // Do not retry for a txn which has a too large MinCommitTs // 3600000 << 18 = 943718400000 From 1e1fe07b0595b5bfa784e6f587e302658855e2b4 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Fri, 26 Apr 2024 10:56:09 +0800 Subject: [PATCH 10/22] *: upgrade grpc 1.63.2 (#1289) Signed-off-by: Weizhen Wang --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- integration_tests/go.mod | 10 +++++----- integration_tests/go.sum | 28 ++++++++++++++-------------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index aa8105ceb0..4c0992c407 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( go.uber.org/goleak v1.2.0 go.uber.org/zap v1.26.0 golang.org/x/sync v0.6.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 ) require ( @@ -49,12 +49,12 @@ require ( go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index cf2c4a7d90..93ea561576 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -176,8 +176,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -204,11 +204,11 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 h1:8eadJkXbwDEMNwcB5O0s5Y5eCfyuCLdvaiOIaGTrWmQ= google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 h1:em/y72n4XlYRtayY/cVj6pnVzHa//BDA1BdoO+z9mdE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9 h1:ATnmU8nL2NfIyTSiBvJVDIDIr3qBmeW+c7z7XU21eWs= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9/go.mod h1:j5uROIAAgi3YmtiETMt1LW0d/lHqQ7wwrIY4uGRXLQ4= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= diff --git a/integration_tests/go.mod b/integration_tests/go.mod index 0c325fe862..b90a09e183 100644 --- a/integration_tests/go.mod +++ b/integration_tests/go.mod @@ -95,17 +95,17 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.19.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/integration_tests/go.sum b/integration_tests/go.sum index 89ea800133..c8081dbde4 100644 --- a/integration_tests/go.sum +++ b/integration_tests/go.sum @@ -648,8 +648,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= @@ -688,8 +688,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= @@ -738,14 +738,14 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -801,12 +801,12 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 h1:8eadJkXbwDEMNwcB5O0s5Y5eCfyuCLdvaiOIaGTrWmQ= google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 h1:em/y72n4XlYRtayY/cVj6pnVzHa//BDA1BdoO+z9mdE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -815,8 +815,8 @@ google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRn google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9 h1:ATnmU8nL2NfIyTSiBvJVDIDIr3qBmeW+c7z7XU21eWs= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9/go.mod h1:j5uROIAAgi3YmtiETMt1LW0d/lHqQ7wwrIY4uGRXLQ4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From 8a03f8d6b129451633004666f013128f22c312ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:41:28 +0800 Subject: [PATCH 11/22] build(deps): bump golang.org/x/net in /examples/txnkv (#1306) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: disksing --- examples/txnkv/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/go.mod b/examples/txnkv/go.mod index 59cb804d77..bbfb25ea63 100644 --- a/examples/txnkv/go.mod +++ b/examples/txnkv/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 5fbbbe4a772612a2aa33ff10b0ffb22120b14b11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:41:57 +0800 Subject: [PATCH 12/22] build(deps): bump golang.org/x/net in /examples/txnkv/async_commit (#1307) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: disksing --- examples/txnkv/async_commit/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/async_commit/go.mod b/examples/txnkv/async_commit/go.mod index 1253bbde79..db10d224f9 100644 --- a/examples/txnkv/async_commit/go.mod +++ b/examples/txnkv/async_commit/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 86d0a004413b8f2a7c6edf69e1abaa628141cee4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:42:17 +0800 Subject: [PATCH 13/22] build(deps): bump golang.org/x/net in /examples/txnkv/delete_range (#1308) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/txnkv/delete_range/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/delete_range/go.mod b/examples/txnkv/delete_range/go.mod index 504dd55adf..6142997cff 100644 --- a/examples/txnkv/delete_range/go.mod +++ b/examples/txnkv/delete_range/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 9037f3a612a7390a08a04116de02194f20dab561 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:42:31 +0800 Subject: [PATCH 14/22] build(deps): bump golang.org/x/net in /examples/gcworker (#1309) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/gcworker/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/gcworker/go.mod b/examples/gcworker/go.mod index 2159df8033..59e984ce7d 100644 --- a/examples/gcworker/go.mod +++ b/examples/gcworker/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From ced64f96522f7c5f16d5268cfdb8f3b392679c22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:59:22 +0800 Subject: [PATCH 15/22] build(deps): bump golang.org/x/net in /examples/txnkv/1pc_txn (#1310) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: disksing --- examples/txnkv/1pc_txn/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/1pc_txn/go.mod b/examples/txnkv/1pc_txn/go.mod index 224ff0bb6d..ba52b50615 100644 --- a/examples/txnkv/1pc_txn/go.mod +++ b/examples/txnkv/1pc_txn/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 7779094ec9a5214b9b887aba4893437b8d121eb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:58:59 +0800 Subject: [PATCH 16/22] build(deps): bump golang.org/x/net in /examples/rawkv (#1311) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/rawkv/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/rawkv/go.mod b/examples/rawkv/go.mod index 45a1c4d08f..b973b79909 100644 --- a/examples/rawkv/go.mod +++ b/examples/rawkv/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From d2b97619cdbebd0d20e7bda8075455ade5507500 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:59:17 +0800 Subject: [PATCH 17/22] build(deps): bump golang.org/x/net in /examples/txnkv/unsafedestoryrange (#1312) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/txnkv/unsafedestoryrange/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/unsafedestoryrange/go.mod b/examples/txnkv/unsafedestoryrange/go.mod index 202531c6df..8eeb1bc1f7 100644 --- a/examples/txnkv/unsafedestoryrange/go.mod +++ b/examples/txnkv/unsafedestoryrange/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 3ed6550f3e44ac0a535e428f0912cd711b09613e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:59:22 +0800 Subject: [PATCH 18/22] build(deps): bump golang.org/x/net in /examples/txnkv/pessimistic_txn (#1313) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/txnkv/pessimistic_txn/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/txnkv/pessimistic_txn/go.mod b/examples/txnkv/pessimistic_txn/go.mod index 4059cefa2b..4b9089c03f 100644 --- a/examples/txnkv/pessimistic_txn/go.mod +++ b/examples/txnkv/pessimistic_txn/go.mod @@ -39,11 +39,10 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect google.golang.org/grpc v1.62.1 // indirect From 9c05078660d9e5c4cb4d2dc748e1fe4d99cf3c5a Mon Sep 17 00:00:00 2001 From: ystaticy Date: Sun, 28 Apr 2024 12:20:55 +0800 Subject: [PATCH 19/22] Add keyspace meta in codec (#1323) Signed-off-by: y_static_y@sina.com --- examples/gcworker/go.mod | 8 +++--- examples/rawkv/go.mod | 8 +++--- examples/txnkv/1pc_txn/go.mod | 8 +++--- examples/txnkv/async_commit/go.mod | 8 +++--- examples/txnkv/delete_range/go.mod | 8 +++--- examples/txnkv/go.mod | 8 +++--- examples/txnkv/pessimistic_txn/go.mod | 8 +++--- examples/txnkv/unsafedestoryrange/go.mod | 8 +++--- internal/apicodec/codec.go | 3 +++ internal/apicodec/codec_v1.go | 5 ++++ internal/apicodec/codec_v2.go | 22 ++++++++++------ internal/apicodec/codec_v2_test.go | 33 ++++++++++++++---------- internal/locate/pd_codec.go | 13 ++++++++-- 13 files changed, 85 insertions(+), 55 deletions(-) diff --git a/examples/gcworker/go.mod b/examples/gcworker/go.mod index 59e984ce7d..c735b5dffa 100644 --- a/examples/gcworker/go.mod +++ b/examples/gcworker/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/rawkv/go.mod b/examples/rawkv/go.mod index b973b79909..ce6121724f 100644 --- a/examples/rawkv/go.mod +++ b/examples/rawkv/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/1pc_txn/go.mod b/examples/txnkv/1pc_txn/go.mod index ba52b50615..dae17ded60 100644 --- a/examples/txnkv/1pc_txn/go.mod +++ b/examples/txnkv/1pc_txn/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/async_commit/go.mod b/examples/txnkv/async_commit/go.mod index db10d224f9..127140732a 100644 --- a/examples/txnkv/async_commit/go.mod +++ b/examples/txnkv/async_commit/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/delete_range/go.mod b/examples/txnkv/delete_range/go.mod index 6142997cff..44cd1df291 100644 --- a/examples/txnkv/delete_range/go.mod +++ b/examples/txnkv/delete_range/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/go.mod b/examples/txnkv/go.mod index bbfb25ea63..9cd62c7fc1 100644 --- a/examples/txnkv/go.mod +++ b/examples/txnkv/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/pessimistic_txn/go.mod b/examples/txnkv/pessimistic_txn/go.mod index 4b9089c03f..f38c91601a 100644 --- a/examples/txnkv/pessimistic_txn/go.mod +++ b/examples/txnkv/pessimistic_txn/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/examples/txnkv/unsafedestoryrange/go.mod b/examples/txnkv/unsafedestoryrange/go.mod index 8eeb1bc1f7..fe52ad5103 100644 --- a/examples/txnkv/unsafedestoryrange/go.mod +++ b/examples/txnkv/unsafedestoryrange/go.mod @@ -39,13 +39,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20230711005742-c3f37128e5a4 // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/internal/apicodec/codec.go b/internal/apicodec/codec.go index 54b5840c9c..7426b04a74 100644 --- a/internal/apicodec/codec.go +++ b/internal/apicodec/codec.go @@ -4,6 +4,7 @@ import ( "encoding/binary" "github.com/pingcap/errors" + "github.com/pingcap/kvproto/pkg/keyspacepb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/tikv/client-go/v2/tikvrpc" ) @@ -48,6 +49,8 @@ type Codec interface { GetKeyspace() []byte // GetKeyspaceID return the keyspace id of the codec. GetKeyspaceID() KeyspaceID + // GetKeyspaceMeta return the keyspace meta of the codec. + GetKeyspaceMeta() *keyspacepb.KeyspaceMeta // EncodeRequest encodes with the given Codec. // NOTE: req is reused on retry. MUST encode on cloned request, other than overwrite the original. EncodeRequest(req *tikvrpc.Request) (*tikvrpc.Request, error) diff --git a/internal/apicodec/codec_v1.go b/internal/apicodec/codec_v1.go index 74e32df993..03ebd1f2a2 100644 --- a/internal/apicodec/codec_v1.go +++ b/internal/apicodec/codec_v1.go @@ -3,6 +3,7 @@ package apicodec import ( "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/errorpb" + "github.com/pingcap/kvproto/pkg/keyspacepb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/tikv/client-go/v2/tikvrpc" ) @@ -215,3 +216,7 @@ func (c *codecV1) DecodeBucketKeys(keys [][]byte) ([][]byte, error) { } return ks, nil } + +func (c *codecV1) GetKeyspaceMeta() *keyspacepb.KeyspaceMeta { + return nil +} diff --git a/internal/apicodec/codec_v2.go b/internal/apicodec/codec_v2.go index 25313d61b5..b23b156509 100644 --- a/internal/apicodec/codec_v2.go +++ b/internal/apicodec/codec_v2.go @@ -7,6 +7,7 @@ import ( "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/errorpb" + "github.com/pingcap/kvproto/pkg/keyspacepb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pkg/errors" @@ -49,15 +50,16 @@ func BuildKeyspaceName(name string) string { // codecV2 is used to encode/decode keys and request into APIv2 format. type codecV2 struct { - keyspaceID KeyspaceID - prefix []byte - endKey []byte - memCodec memCodec + prefix []byte + endKey []byte + memCodec memCodec + keyspaceMeta *keyspacepb.KeyspaceMeta } // NewCodecV2 returns a codec that can be used to encode/decode // keys and requests to and from APIv2 format. -func NewCodecV2(mode Mode, keyspaceID uint32) (Codec, error) { +func NewCodecV2(mode Mode, keyspaceMeta *keyspacepb.KeyspaceMeta) (Codec, error) { + keyspaceID := keyspaceMeta.Id if keyspaceID > maxKeyspaceID { return nil, errors.Errorf("keyspaceID %d is out of range, maximum is %d", keyspaceID, maxKeyspaceID) } @@ -66,9 +68,9 @@ func NewCodecV2(mode Mode, keyspaceID uint32) (Codec, error) { return nil, err } codec := &codecV2{ - keyspaceID: KeyspaceID(keyspaceID), // Region keys in CodecV2 are always encoded in memory comparable form. - memCodec: &memComparableCodec{}, + memCodec: &memComparableCodec{}, + keyspaceMeta: keyspaceMeta, } codec.prefix = make([]byte, 4) codec.endKey = make([]byte, 4) @@ -106,7 +108,11 @@ func (c *codecV2) GetKeyspace() []byte { } func (c *codecV2) GetKeyspaceID() KeyspaceID { - return c.keyspaceID + return KeyspaceID(c.keyspaceMeta.Id) +} + +func (c *codecV2) GetKeyspaceMeta() *keyspacepb.KeyspaceMeta { + return c.keyspaceMeta } func (c *codecV2) GetAPIVersion() kvrpcpb.APIVersion { diff --git a/internal/apicodec/codec_v2_test.go b/internal/apicodec/codec_v2_test.go index 04180b807b..67d9009d5d 100644 --- a/internal/apicodec/codec_v2_test.go +++ b/internal/apicodec/codec_v2_test.go @@ -6,6 +6,7 @@ import ( "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/errorpb" + "github.com/pingcap/kvproto/pkg/keyspacepb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/kvproto/pkg/mpp" @@ -38,7 +39,10 @@ func TestCodecV2(t *testing.T) { } func (suite *testCodecV2Suite) SetupSuite() { - codec, err := NewCodecV2(ModeRaw, testKeyspaceID) + testKeyspaceMeta := keyspacepb.KeyspaceMeta{ + Id: testKeyspaceID, + } + codec, err := NewCodecV2(ModeRaw, &testKeyspaceMeta) suite.NoError(err) suite.Equal(keyspacePrefix, codec.GetKeyspace()) suite.codec = codec.(*codecV2) @@ -110,7 +114,7 @@ func (suite *testCodecV2Suite) TestNewCodecV2() { re := suite.Require() testCases := []struct { mode Mode - spaceID uint32 + keyspaceID uint32 shouldErr bool expectedPrefix []byte expectedEnd []byte @@ -118,54 +122,57 @@ func (suite *testCodecV2Suite) TestNewCodecV2() { { mode: ModeRaw, // A too large keyspaceID should result in error. - spaceID: math.MaxUint32, - shouldErr: true, + keyspaceID: math.MaxUint32, + shouldErr: true, }, { // Bad mode should result in error. - mode: Mode(99), - spaceID: DefaultKeyspaceID, - shouldErr: true, + mode: Mode(99), + keyspaceID: DefaultKeyspaceID, + shouldErr: true, }, { mode: ModeRaw, - spaceID: 1<<24 - 2, + keyspaceID: 1<<24 - 2, expectedPrefix: []byte{'r', 255, 255, 254}, expectedEnd: []byte{'r', 255, 255, 255}, }, { // EndKey should be able to carry over increment from lower byte. mode: ModeTxn, - spaceID: 1<<8 - 1, + keyspaceID: 1<<8 - 1, expectedPrefix: []byte{'x', 0, 0, 255}, expectedEnd: []byte{'x', 0, 1, 0}, }, { // EndKey should be able to carry over increment from lower byte. mode: ModeTxn, - spaceID: 1<<16 - 1, + keyspaceID: 1<<16 - 1, expectedPrefix: []byte{'x', 0, 255, 255}, expectedEnd: []byte{'x', 1, 0, 0}, }, { // If prefix is the last keyspace, then end should change the mode byte. mode: ModeRaw, - spaceID: 1<<24 - 1, + keyspaceID: 1<<24 - 1, expectedPrefix: []byte{'r', 255, 255, 255}, expectedEnd: []byte{'s', 0, 0, 0}, }, } for _, testCase := range testCases { + + keyspaceMeta := &keyspacepb.KeyspaceMeta{Id: testCase.keyspaceID} if testCase.shouldErr { - _, err := NewCodecV2(testCase.mode, testCase.spaceID) + _, err := NewCodecV2(testCase.mode, keyspaceMeta) re.Error(err) continue } - codec, err := NewCodecV2(testCase.mode, testCase.spaceID) + codec, err := NewCodecV2(testCase.mode, keyspaceMeta) re.NoError(err) v2Codec, ok := codec.(*codecV2) re.True(ok) + re.Equal(keyspaceMeta, v2Codec.keyspaceMeta) re.Equal(testCase.expectedPrefix, v2Codec.prefix) re.Equal(testCase.expectedEnd, v2Codec.endKey) } diff --git a/internal/locate/pd_codec.go b/internal/locate/pd_codec.go index c2d768731f..88e187e07c 100644 --- a/internal/locate/pd_codec.go +++ b/internal/locate/pd_codec.go @@ -60,11 +60,11 @@ func NewCodecPDClient(mode apicodec.Mode, client pd.Client) *CodecPDClient { // NewCodecPDClientWithKeyspace creates a CodecPDClient in API v2 with keyspace name. func NewCodecPDClientWithKeyspace(mode apicodec.Mode, client pd.Client, keyspace string) (*CodecPDClient, error) { - id, err := GetKeyspaceID(client, keyspace) + keyspaceMeta, err := GetKeyspaceMeta(client, keyspace) if err != nil { return nil, err } - codec, err := apicodec.NewCodecV2(mode, id) + codec, err := apicodec.NewCodecV2(mode, keyspaceMeta) if err != nil { return nil, err } @@ -85,6 +85,15 @@ func GetKeyspaceID(client pd.Client, name string) (uint32, error) { return meta.Id, nil } +// GetKeyspaceMeta attempts to retrieve keyspace meta corresponding to the given keyspace name from PD. +func GetKeyspaceMeta(client pd.Client, name string) (*keyspacepb.KeyspaceMeta, error) { + meta, err := client.LoadKeyspace(context.Background(), apicodec.BuildKeyspaceName(name)) + if err != nil { + return nil, err + } + return meta, nil +} + // GetCodec returns CodecPDClient's codec. func (c *CodecPDClient) GetCodec() apicodec.Codec { return c.codec From 31a502b9ba4d4856805e7cf92c0cdb8b98ae9a0f Mon Sep 17 00:00:00 2001 From: crazycs Date: Mon, 29 Apr 2024 15:56:32 +0800 Subject: [PATCH 20/22] improve region request log for diagnose (#1300) * improve region request log for diagnose Signed-off-by: crazycs520 * rename struct Signed-off-by: crazycs520 * refine region error metric with store id label and add rpc error metric Signed-off-by: crazycs520 * refine comment Signed-off-by: crazycs520 * refine code Signed-off-by: crazycs520 * restrict log Signed-off-by: crazycs520 * refine code Signed-off-by: crazycs520 * refine Signed-off-by: crazycs520 * refine Signed-off-by: crazycs520 * refine log Signed-off-by: crazycs520 * refine code Signed-off-by: crazycs520 * fix test Signed-off-by: crazycs520 * address comment Signed-off-by: crazycs520 * refine Signed-off-by: crazycs520 * refine Signed-off-by: crazycs520 * refine log Signed-off-by: crazycs520 --------- Signed-off-by: crazycs520 --- integration_tests/main_test.go | 1 + integration_tests/snapshot_test.go | 8 +- internal/locate/region_request.go | 351 +++++++++++++++++++----- internal/locate/region_request3_test.go | 26 +- internal/locate/region_request_test.go | 44 +++ metrics/metrics.go | 13 +- tikv/region.go | 7 +- txnkv/txnsnapshot/client_helper.go | 6 +- txnkv/txnsnapshot/snapshot.go | 44 ++- txnkv/txnsnapshot/test_probe.go | 5 +- 10 files changed, 386 insertions(+), 119 deletions(-) diff --git a/integration_tests/main_test.go b/integration_tests/main_test.go index fcd7a050a7..5998804baf 100644 --- a/integration_tests/main_test.go +++ b/integration_tests/main_test.go @@ -27,6 +27,7 @@ func TestMain(m *testing.M) { opts := []goleak.Option{ goleak.IgnoreTopFunction("github.com/pingcap/goleveldb/leveldb.(*DB).mpoolDrain"), goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), // TODO: fix ttlManager goroutine leak + goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2"), } goleak.VerifyTestMain(m, opts...) diff --git a/integration_tests/snapshot_test.go b/integration_tests/snapshot_test.go index a8244ed4fa..aee209543e 100644 --- a/integration_tests/snapshot_test.go +++ b/integration_tests/snapshot_test.go @@ -303,13 +303,13 @@ func (s *testSnapshotSuite) TestSnapshotThreadSafe() { func (s *testSnapshotSuite) TestSnapshotRuntimeStats() { reqStats := tikv.NewRegionRequestRuntimeStats() - tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Second) - tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Millisecond) + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Second) + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Millisecond) snapshot := s.store.GetSnapshot(0) runtimeStats := &txnkv.SnapshotRuntimeStats{} snapshot.SetRuntimeStats(runtimeStats) - snapshot.MergeRegionRequestStats(reqStats.Stats) - snapshot.MergeRegionRequestStats(reqStats.Stats) + snapshot.MergeRegionRequestStats(reqStats) + snapshot.MergeRegionRequestStats(reqStats) bo := tikv.NewBackofferWithVars(context.Background(), 2000, nil) err := bo.BackoffWithMaxSleepTxnLockFast(5, errors.New("test")) s.Nil(err) diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index be3103d055..07dda82e5a 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -35,9 +35,9 @@ package locate import ( - "bytes" "context" "fmt" + "maps" "math" "math/rand" "strconv" @@ -113,7 +113,8 @@ type RegionRequestSender struct { replicaSelector ReplicaSelector failStoreIDs map[uint64]struct{} failProxyStoreIDs map[uint64]struct{} - RegionRequestRuntimeStats + Stats *RegionRequestRuntimeStats + AccessStats *ReplicaAccessStats } func (s *RegionRequestSender) String() string { @@ -125,13 +126,22 @@ func (s *RegionRequestSender) String() string { // RegionRequestRuntimeStats records the runtime stats of send region requests. type RegionRequestRuntimeStats struct { - Stats map[tikvrpc.CmdType]*RPCRuntimeStats + RPCStats map[tikvrpc.CmdType]*RPCRuntimeStats + RequestErrorStats +} + +// RequestErrorStats records the request error(region error and rpc error) count. +type RequestErrorStats struct { + // ErrStats record the region error and rpc error, and their count. + // Attention: avoid too many error types, ErrStats only record the first 16 different errors. + ErrStats map[string]int + OtherErrCnt int } // NewRegionRequestRuntimeStats returns a new RegionRequestRuntimeStats. -func NewRegionRequestRuntimeStats() RegionRequestRuntimeStats { - return RegionRequestRuntimeStats{ - Stats: make(map[tikvrpc.CmdType]*RPCRuntimeStats), +func NewRegionRequestRuntimeStats() *RegionRequestRuntimeStats { + return &RegionRequestRuntimeStats{ + RPCStats: make(map[tikvrpc.CmdType]*RPCRuntimeStats), } } @@ -142,14 +152,44 @@ type RPCRuntimeStats struct { Consume int64 } +// RecordRPCRuntimeStats uses to record the rpc count and duration stats. +func (r *RegionRequestRuntimeStats) RecordRPCRuntimeStats(cmd tikvrpc.CmdType, d time.Duration) { + stat, ok := r.RPCStats[cmd] + if !ok { + r.RPCStats[cmd] = &RPCRuntimeStats{ + Count: 1, + Consume: int64(d), + } + return + } + stat.Count++ + stat.Consume += int64(d) +} + +// RecordRPCErrorStats uses to record the request error(region error label and rpc error) info and count. +func (r *RequestErrorStats) RecordRPCErrorStats(errLabel string) { + if r.ErrStats == nil { + // lazy init to avoid unnecessary allocation. + r.ErrStats = make(map[string]int) + } + if len(r.ErrStats) < 16 { + // Avoid too many error. + r.ErrStats[errLabel]++ + } else { + r.OtherErrCnt++ + } +} + // String implements fmt.Stringer interface. func (r *RegionRequestRuntimeStats) String() string { + if r == nil { + return "" + } var builder strings.Builder - for k, v := range r.Stats { + for k, v := range r.RPCStats { if builder.Len() > 0 { builder.WriteByte(',') } - // append string: fmt.Sprintf("%s:{num_rpc:%v, total_time:%s}", k.String(), v.Count, util.FormatDuration(time.Duration(v.Consume))") builder.WriteString(k.String()) builder.WriteString(":{num_rpc:") builder.WriteString(strconv.FormatInt(v.Count, 10)) @@ -157,27 +197,57 @@ func (r *RegionRequestRuntimeStats) String() string { builder.WriteString(util.FormatDuration(time.Duration(v.Consume))) builder.WriteString("}") } + if errStatsStr := r.RequestErrorStats.String(); errStatsStr != "" { + builder.WriteString(", rpc_errors:") + builder.WriteString(errStatsStr) + } + return builder.String() +} + +// String implements fmt.Stringer interface. +func (r *RequestErrorStats) String() string { + if len(r.ErrStats) == 0 { + return "" + } + var builder strings.Builder + builder.WriteString("{") + for err, cnt := range r.ErrStats { + if builder.Len() > 2 { + builder.WriteString(", ") + } + builder.WriteString(err) + builder.WriteString(":") + builder.WriteString(strconv.Itoa(cnt)) + } + if r.OtherErrCnt > 0 { + builder.WriteString(", other_error:") + builder.WriteString(strconv.Itoa(r.OtherErrCnt)) + } + builder.WriteString("}") return builder.String() } // Clone returns a copy of itself. -func (r *RegionRequestRuntimeStats) Clone() RegionRequestRuntimeStats { +func (r *RegionRequestRuntimeStats) Clone() *RegionRequestRuntimeStats { newRs := NewRegionRequestRuntimeStats() - for cmd, v := range r.Stats { - newRs.Stats[cmd] = &RPCRuntimeStats{ - Count: v.Count, - Consume: v.Consume, - } + maps.Copy(newRs.RPCStats, r.RPCStats) + if len(r.ErrStats) > 0 { + newRs.ErrStats = make(map[string]int) + maps.Copy(newRs.ErrStats, r.ErrStats) + newRs.OtherErrCnt = r.OtherErrCnt } return newRs } // Merge merges other RegionRequestRuntimeStats. -func (r *RegionRequestRuntimeStats) Merge(rs RegionRequestRuntimeStats) { - for cmd, v := range rs.Stats { - stat, ok := r.Stats[cmd] +func (r *RegionRequestRuntimeStats) Merge(rs *RegionRequestRuntimeStats) { + if rs == nil { + return + } + for cmd, v := range rs.RPCStats { + stat, ok := r.RPCStats[cmd] if !ok { - r.Stats[cmd] = &RPCRuntimeStats{ + r.RPCStats[cmd] = &RPCRuntimeStats{ Count: v.Count, Consume: v.Consume, } @@ -186,20 +256,114 @@ func (r *RegionRequestRuntimeStats) Merge(rs RegionRequestRuntimeStats) { stat.Count += v.Count stat.Consume += v.Consume } + if len(rs.ErrStats) > 0 { + if r.ErrStats == nil { + r.ErrStats = make(map[string]int) + } + for err, cnt := range rs.ErrStats { + r.ErrStats[err] += cnt + } + r.OtherErrCnt += rs.OtherErrCnt + } +} + +// ReplicaAccessStats records the replica access info. +type ReplicaAccessStats struct { + // AccessInfos records the access info + AccessInfos []ReplicaAccessInfo + // avoid to consume too much memory, after more than 5 records, count them by peerID in `OverflowAccessStat` map. + OverflowAccessStat map[uint64]*RequestErrorStats } -// RecordRegionRequestRuntimeStats records request runtime stats. -func RecordRegionRequestRuntimeStats(stats map[tikvrpc.CmdType]*RPCRuntimeStats, cmd tikvrpc.CmdType, d time.Duration) { - stat, ok := stats[cmd] +// ReplicaAccessInfo indicates the access path detail info of a request. +type ReplicaAccessInfo struct { + Peer uint64 + Store uint64 + ReqReadTp ReqReadType + Err string +} + +type ReqReadType byte + +const ( + ReqLeader ReqReadType = iota + ReqReplicaRead + ReqStaleRead +) + +func (s *ReplicaAccessStats) recordReplicaAccessInfo(staleRead, replicaRead bool, peerID, storeID uint64, err string) { + if len(s.AccessInfos) < 5 { + tp := ReqLeader + if replicaRead { + tp = ReqReplicaRead + } else if staleRead { + tp = ReqStaleRead + } + s.AccessInfos = append(s.AccessInfos, ReplicaAccessInfo{ + Peer: peerID, + Store: storeID, + ReqReadTp: tp, + Err: err, + }) + return + } + if s.OverflowAccessStat == nil { + s.OverflowAccessStat = make(map[uint64]*RequestErrorStats) + } + stat, ok := s.OverflowAccessStat[peerID] if !ok { - stats[cmd] = &RPCRuntimeStats{ - Count: 1, - Consume: int64(d), + stat = &RequestErrorStats{} + s.OverflowAccessStat[peerID] = stat + } + stat.RecordRPCErrorStats(err) +} + +// String implements fmt.Stringer interface. +func (s *ReplicaAccessStats) String() string { + if s == nil { + return "" + } + var builder strings.Builder + for i, info := range s.AccessInfos { + if i > 0 { + builder.WriteString(", ") + } + switch info.ReqReadTp { + case ReqLeader: + builder.WriteString("{") + case ReqReplicaRead: + builder.WriteString("{replica_read, ") + case ReqStaleRead: + builder.WriteString("{stale_read, ") + } + builder.WriteString("peer:") + builder.WriteString(strconv.FormatUint(info.Peer, 10)) + builder.WriteString(", store:") + builder.WriteString(strconv.FormatUint(info.Store, 10)) + builder.WriteString(", err:") + builder.WriteString(info.Err) + builder.WriteString("}") + } + if len(s.OverflowAccessStat) > 0 { + builder.WriteString(", overflow_count:{") + cnt := 0 + for peerID, stat := range s.OverflowAccessStat { + if stat == nil { + continue + } + if cnt > 0 { + builder.WriteString(", ") + } + builder.WriteString("{peer:") + builder.WriteString(strconv.FormatUint(peerID, 10)) + builder.WriteString(", error_stats:") + builder.WriteString(stat.String()) + builder.WriteString("}") + cnt++ } - return + builder.WriteString("}") } - stat.Count++ - stat.Consume += int64(d) + return builder.String() } // NewRegionRequestSender creates a new sender. @@ -259,6 +423,16 @@ func (s *RegionRequestSender) SendReq( return resp, retryTimes, err } +func (s *RegionRequestSender) recordRPCAccessInfo(req *tikvrpc.Request, rpcCtx *RPCContext, err string) { + if req == nil || rpcCtx == nil || rpcCtx.Peer == nil || rpcCtx.Store == nil { + return + } + if s.AccessStats == nil { + s.AccessStats = &ReplicaAccessStats{} + } + s.AccessStats.recordReplicaAccessInfo(req.StaleRead, req.ReplicaRead, rpcCtx.Peer.GetId(), rpcCtx.Store.storeID, err) +} + type replica struct { store *Store peer *metapb.Peer @@ -383,11 +557,12 @@ func (s *baseReplicaSelector) String() string { } for _, replica := range s.replicas { replicaStatus = append(replicaStatus, fmt.Sprintf("peer: %v, store: %v, isEpochStale: %v, "+ - "attempts: %v, replica-epoch: %v, store-epoch: %v, store-state: %v, store-liveness-state: %v", + "attempts: %v, attempts_time: %v, replica-epoch: %v, store-epoch: %v, store-state: %v, store-liveness-state: %v", replica.peer.GetId(), replica.store.storeID, replica.isEpochStale(), replica.attempts, + util.FormatDuration(replica.attemptedTime), replica.getEpoch(), atomic.LoadUint32(&replica.store.epoch), replica.store.getResolveState(), @@ -1453,6 +1628,8 @@ func IsFakeRegionError(err *errorpb.Error) bool { return err != nil && err.GetEpochNotMatch() != nil && len(err.GetEpochNotMatch().CurrentRegions) == 0 } +const slowLogSendReqTime = 100 * time.Millisecond + // SendReqCtx sends a request to tikv server and return response and RPCCtx of this RPC. func (s *RegionRequestSender) SendReqCtx( bo *retry.Backoffer, @@ -1519,6 +1696,8 @@ func (s *RegionRequestSender) SendReqCtx( } s.reset() + startTime := time.Now() + startBackOff := bo.GetTotalSleep() retryTimes = 0 defer func() { if retryTimes > 0 { @@ -1538,7 +1717,6 @@ func (s *RegionRequestSender) SendReqCtx( }() } - totalErrors := make(map[string]int) for { if retryTimes > 0 { if retryTimes%100 == 0 { @@ -1570,11 +1748,13 @@ func (s *RegionRequestSender) SendReqCtx( // TODO: Change the returned error to something like "region missing in cache", // and handle this error like EpochNotMatch, which means to re-split the request and retry. - s.logSendReqError(bo, "throwing pseudo region error due to no replica available", regionID, retryTimes, req, totalErrors) if s.replicaSelector != nil { if err := s.replicaSelector.getBaseReplicaSelector().backoffOnNoCandidate(bo); err != nil { return nil, nil, retryTimes, err } + if cost := time.Since(startTime); cost > slowLogSendReqTime || cost > timeout { + s.logSendReqError(bo, "throwing pseudo region error due to no replica available", regionID, retryTimes, req, cost, bo.GetTotalSleep()-startBackOff, timeout) + } } resp, err = tikvrpc.GenRegionErrorResp(req, &errorpb.Error{EpochNotMatch: &errorpb.EpochNotMatch{}}) return resp, nil, retryTimes, err @@ -1616,8 +1796,10 @@ func (s *RegionRequestSender) SendReqCtx( resp, retry, err = s.sendReqToRegion(bo, rpcCtx, req, timeout) req.IsRetryRequest = true if err != nil { - msg := fmt.Sprintf("send request failed, err: %v", err.Error()) - s.logSendReqError(bo, msg, regionID, retryTimes, req, totalErrors) + if cost := time.Since(startTime); cost > slowLogSendReqTime || cost > timeout { + msg := fmt.Sprintf("send request failed, err: %v", err.Error()) + s.logSendReqError(bo, msg, regionID, retryTimes, req, cost, bo.GetTotalSleep()-startBackOff, timeout) + } return nil, nil, retryTimes, err } @@ -1648,19 +1830,21 @@ func (s *RegionRequestSender) SendReqCtx( return nil, nil, retryTimes, err } if regionErr != nil { - regionErrLogging := regionErrorToLogging(rpcCtx.Peer.GetId(), regionErr) - totalErrors[regionErrLogging]++ retry, err = s.onRegionError(bo, rpcCtx, req, regionErr) if err != nil { - msg := fmt.Sprintf("send request on region error failed, err: %v", err.Error()) - s.logSendReqError(bo, msg, regionID, retryTimes, req, totalErrors) + if cost := time.Since(startTime); cost > slowLogSendReqTime || cost > timeout { + msg := fmt.Sprintf("send request on region error failed, err: %v", err.Error()) + s.logSendReqError(bo, msg, regionID, retryTimes, req, cost, bo.GetTotalSleep()-startBackOff, timeout) + } return nil, nil, retryTimes, err } if retry { retryTimes++ continue } - s.logSendReqError(bo, "send request meet region error without retry", regionID, retryTimes, req, totalErrors) + if cost := time.Since(startTime); cost > slowLogSendReqTime || cost > timeout { + s.logSendReqError(bo, "send request meet region error without retry", regionID, retryTimes, req, cost, bo.GetTotalSleep()-startBackOff, timeout) + } } else { if s.replicaSelector != nil { s.replicaSelector.onSendSuccess(req) @@ -1673,16 +1857,40 @@ func (s *RegionRequestSender) SendReqCtx( } } -func (s *RegionRequestSender) logSendReqError(bo *retry.Backoffer, msg string, regionID RegionVerID, retryTimes int, req *tikvrpc.Request, totalErrors map[string]int) { - var totalErrorStr bytes.Buffer - for err, cnt := range totalErrors { - if totalErrorStr.Len() > 0 { - totalErrorStr.WriteString(", ") - } - totalErrorStr.WriteString(err) - totalErrorStr.WriteString(":") - totalErrorStr.WriteString(strconv.Itoa(cnt)) +func (s *RegionRequestSender) logSendReqError(bo *retry.Backoffer, msg string, regionID RegionVerID, retryTimes int, req *tikvrpc.Request, cost time.Duration, currentBackoffMs int, timeout time.Duration) { + var builder strings.Builder + // build the total round stats string. + builder.WriteString("{total-backoff: ") + builder.WriteString(util.FormatDuration(time.Duration(bo.GetTotalSleep() * int(time.Millisecond)))) + builder.WriteString(", total-backoff-times: ") + builder.WriteString(strconv.Itoa(bo.GetTotalBackoffTimes())) + if s.Stats != nil { + builder.WriteString(", total-rpc: {") + builder.WriteString(s.Stats.String()) + builder.WriteString("}") } + builder.WriteString("}") + totalRoundStats := builder.String() + + // build the current round stats string. + builder.Reset() + builder.WriteString("{time: ") + builder.WriteString(util.FormatDuration(cost)) + builder.WriteString(", backoff: ") + builder.WriteString(util.FormatDuration(time.Duration(currentBackoffMs * int(time.Millisecond)))) + builder.WriteString(", timeout: ") + builder.WriteString(util.FormatDuration(timeout)) + builder.WriteString(", req-max-exec-timeout: ") + builder.WriteString(util.FormatDuration(time.Duration(int64(req.Context.MaxExecutionDurationMs) * int64(time.Millisecond)))) + builder.WriteString(", retry-times: ") + builder.WriteString(strconv.Itoa(retryTimes)) + if s.AccessStats != nil { + builder.WriteString(", replica-access: {") + builder.WriteString(s.AccessStats.String()) + builder.WriteString("}") + } + builder.WriteString("}") + currentRoundStats := builder.String() logutil.Logger(bo.GetCtx()).Info(msg, zap.Uint64("req-ts", req.GetStartTS()), zap.String("req-type", req.Type.String()), @@ -1690,11 +1898,8 @@ func (s *RegionRequestSender) logSendReqError(bo *retry.Backoffer, msg string, r zap.String("replica-read-type", req.ReplicaReadType.String()), zap.Bool("stale-read", req.StaleRead), zap.Stringer("request-sender", s), - zap.Int("retry-times", retryTimes), - zap.Int("total-backoff-ms", bo.GetTotalSleep()), - zap.Int("total-backoff-times", bo.GetTotalBackoffTimes()), - zap.Uint64("max-exec-timeout-ms", req.Context.MaxExecutionDurationMs), - zap.String("total-region-errors", totalErrorStr.String())) + zap.String("total-round-stats", totalRoundStats), + zap.String("current-round-stats", currentRoundStats)) } // RPCCancellerCtxKey is context key attach rpc send cancelFunc collector to ctx. @@ -1842,7 +2047,7 @@ func (s *RegionRequestSender) sendReqToRegion( rpcCtx.Store.healthStatus.recordClientSideSlowScoreStat(rpcDuration) } if s.Stats != nil { - RecordRegionRequestRuntimeStats(s.Stats, req.Type, rpcDuration) + s.Stats.RecordRPCRuntimeStats(req.Type, rpcDuration) if val, fpErr := util.EvalFailpoint("tikvStoreRespResult"); fpErr == nil { if val.(bool) { if req.Type == tikvrpc.CmdCop && bo.GetTotalSleep() == 0 { @@ -1909,11 +2114,16 @@ func (s *RegionRequestSender) sendReqToRegion( if err != nil { s.rpcError = err - + if s.Stats != nil { + errStr := errors.Cause(err).Error() + s.Stats.RecordRPCErrorStats(errStr) + s.recordRPCAccessInfo(req, rpcCtx, errStr) + } // Because in rpc logic, context.Cancel() will be transferred to rpcContext.Cancel error. For rpcContext cancel, // we need to retry the request. But for context cancel active, for example, limitExec gets the required rows, // we shouldn't retry the request, it will go to backoff and hang in retry logic. if ctx.Err() != nil && errors.Cause(ctx.Err()) == context.Canceled { + metrics.TiKVRPCErrorCounter.WithLabelValues("context-canceled", storeIDLabel(rpcCtx)).Inc() return nil, false, errors.WithStack(ctx.Err()) } @@ -1930,6 +2140,13 @@ func (s *RegionRequestSender) sendReqToRegion( return } +func storeIDLabel(rpcCtx *RPCContext) string { + if rpcCtx != nil && rpcCtx.Store != nil { + return strconv.FormatUint(rpcCtx.Store.storeID, 10) + } + return "nil" +} + func (s *RegionRequestSender) getStoreToken(st *Store, limit int64) error { // Checking limit is not thread safe, preferring this for avoiding load in loop. count := st.tokenCount.Load() @@ -1958,19 +2175,25 @@ func (s *RegionRequestSender) onSendFail(bo *retry.Backoffer, ctx *RPCContext, r defer span1.Finish() bo.SetCtx(opentracing.ContextWithSpan(bo.GetCtx(), span1)) } + storeLabel := storeIDLabel(ctx) // If it failed because the context is cancelled by ourself, don't retry. if errors.Cause(err) == context.Canceled { + metrics.TiKVRPCErrorCounter.WithLabelValues("context-canceled", storeLabel).Inc() return errors.WithStack(err) } else if LoadShuttingDown() > 0 { + metrics.TiKVRPCErrorCounter.WithLabelValues("shutting-down", storeLabel).Inc() return errors.WithStack(tikverr.ErrTiDBShuttingDown) } else if isCauseByDeadlineExceeded(err) { if s.replicaSelector != nil && s.replicaSelector.onReadReqConfigurableTimeout(req) { + errLabel := "read-timeout-" + strconv.FormatUint(req.MaxExecutionDurationMs, 10) + "ms" + metrics.TiKVRPCErrorCounter.WithLabelValues(errLabel, storeLabel).Inc() return nil } } if status.Code(errors.Cause(err)) == codes.Canceled { select { case <-bo.GetCtx().Done(): + metrics.TiKVRPCErrorCounter.WithLabelValues("grpc-canceled", storeLabel).Inc() return errors.WithStack(err) default: // If we don't cancel, but the error code is Canceled, it may be canceled by keepalive or gRPC remote. @@ -1988,6 +2211,7 @@ func (s *RegionRequestSender) onSendFail(bo *retry.Backoffer, ctx *RPCContext, r } } } + metrics.TiKVRPCErrorCounter.WithLabelValues(errors.Cause(err).Error(), storeLabel).Inc() if ctx.Store != nil && ctx.Store.storeType == tikvrpc.TiFlashCompute { s.regionCache.InvalidateTiFlashComputeStoresIfGRPCError(err) @@ -2064,17 +2288,17 @@ func (s *RegionRequestSender) NeedReloadRegion(ctx *RPCContext) (need bool) { } // regionErrorToLogging constructs the logging content with extra information like returned leader peer id. -func regionErrorToLogging(peerID uint64, e *errorpb.Error) string { - str := regionErrorToLabel(e) +func regionErrorToLogging(e *errorpb.Error, errLabel string) string { + str := errLabel if e.GetNotLeader() != nil { notLeader := e.GetNotLeader() if notLeader.GetLeader() != nil { - str = fmt.Sprintf("%v-%v", str, notLeader.GetLeader().GetId()) + str = fmt.Sprintf("%v_with_leader_%v", str, notLeader.GetLeader().GetId()) } else { - str = fmt.Sprintf("%v-nil", str) + str = fmt.Sprintf("%v_with_no_leader", str) } } - return fmt.Sprintf("%v-%v", peerID, str) + return str } func regionErrorToLabel(e *errorpb.Error) string { @@ -2140,13 +2364,14 @@ func (s *RegionRequestSender) onRegionError( bo.SetCtx(opentracing.ContextWithSpan(bo.GetCtx(), span1)) } - // NOTE: Please add the region error handler in the same order of errorpb.Error. - isInternal := false - if req != nil { - isInternal = util.IsInternalRequest(req.GetRequestSource()) + regionErrLabel := regionErrorToLabel(regionErr) + metrics.TiKVRegionErrorCounter.WithLabelValues(regionErrLabel, storeIDLabel(ctx)).Inc() + if s.Stats != nil { + s.Stats.RecordRPCErrorStats(regionErrLabel) + s.recordRPCAccessInfo(req, ctx, regionErrorToLogging(regionErr, regionErrLabel)) } - metrics.TiKVRegionErrorCounter.WithLabelValues(regionErrorToLabel(regionErr), strconv.FormatBool(isInternal)).Inc() + // NOTE: Please add the region error handler in the same order of errorpb.Error. if notLeader := regionErr.GetNotLeader(); notLeader != nil { // Retry if error is `NotLeader`. logutil.Logger(bo.GetCtx()).Debug( diff --git a/internal/locate/region_request3_test.go b/internal/locate/region_request3_test.go index 32ed218d7b..8a72dba3ff 100644 --- a/internal/locate/region_request3_test.go +++ b/internal/locate/region_request3_test.go @@ -1219,7 +1219,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestAccessFollowerAfter1TiKVDown() func (s *testRegionRequestToThreeStoresSuite) TestSendReqFirstTimeout() { leaderAddr := "" reqTargetAddrs := make(map[string]struct{}) - s.regionRequestSender.RegionRequestRuntimeStats = NewRegionRequestRuntimeStats() + s.regionRequestSender.Stats = NewRegionRequestRuntimeStats() bo := retry.NewBackoffer(context.Background(), 10000) mockRPCClient := &fnClient{fn: func(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (*tikvrpc.Response, error) { reqTargetAddrs[addr] = struct{}{} @@ -1243,7 +1243,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqFirstTimeout() { resetStats := func() { reqTargetAddrs = make(map[string]struct{}) s.regionRequestSender = NewRegionRequestSender(s.cache, mockRPCClient) - s.regionRequestSender.RegionRequestRuntimeStats = NewRegionRequestRuntimeStats() + s.regionRequestSender.Stats = NewRegionRequestRuntimeStats() } //Test different read type. @@ -1266,10 +1266,10 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqFirstTimeout() { regionErr, err := resp.GetRegionError() s.Nil(err) s.True(IsFakeRegionError(regionErr)) - s.Equal(1, len(s.regionRequestSender.Stats)) - s.Equal(int64(3), s.regionRequestSender.Stats[tikvrpc.CmdGet].Count) // 3 rpc - s.Equal(3, len(reqTargetAddrs)) // each rpc to a different store. - s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. + s.Equal(1, len(s.regionRequestSender.Stats.RPCStats)) + s.Equal(int64(3), s.regionRequestSender.Stats.RPCStats[tikvrpc.CmdGet].Count) // 3 rpc + s.Equal(3, len(reqTargetAddrs)) // each rpc to a different store. + s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. // warn: must rest MaxExecutionDurationMs before retry. resetStats() if staleRead { @@ -1285,9 +1285,9 @@ func (s *testRegionRequestToThreeStoresSuite) TestSendReqFirstTimeout() { s.Nil(err) s.Nil(regionErr) s.Equal([]byte("value"), resp.Resp.(*kvrpcpb.GetResponse).Value) - s.Equal(1, len(s.regionRequestSender.Stats)) - s.Equal(int64(1), s.regionRequestSender.Stats[tikvrpc.CmdGet].Count) // 1 rpc - s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. + s.Equal(1, len(s.regionRequestSender.Stats.RPCStats)) + s.Equal(int64(1), s.regionRequestSender.Stats.RPCStats[tikvrpc.CmdGet].Count) // 1 rpc + s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. } } @@ -1482,7 +1482,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestStaleReadTryFollowerAfterTimeo return &tikvrpc.Response{Resp: &kvrpcpb.GetResponse{Value: []byte("value")}}, nil }} s.regionRequestSender = NewRegionRequestSender(s.cache, mockRPCClient) - s.regionRequestSender.RegionRequestRuntimeStats = NewRegionRequestRuntimeStats() + s.regionRequestSender.Stats = NewRegionRequestRuntimeStats() getLocFn := func() *KeyLocation { loc, err := s.regionRequestSender.regionCache.LocateKey(bo, []byte("a")) s.Nil(err) @@ -1504,9 +1504,9 @@ func (s *testRegionRequestToThreeStoresSuite) TestStaleReadTryFollowerAfterTimeo s.Nil(err) s.Nil(regionErr) s.Equal([]byte("value"), resp.Resp.(*kvrpcpb.GetResponse).Value) - s.Equal(1, len(s.regionRequestSender.Stats)) - s.Equal(int64(2), s.regionRequestSender.Stats[tikvrpc.CmdGet].Count) // 2 rpc - s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. + s.Equal(1, len(s.regionRequestSender.Stats.RPCStats)) + s.Equal(int64(2), s.regionRequestSender.Stats.RPCStats[tikvrpc.CmdGet].Count) // 2 rpc + s.Equal(0, bo.GetTotalBackoffTimes()) // no backoff since fast retry. } func (s *testRegionRequestToThreeStoresSuite) TestDoNotTryUnreachableLeader() { diff --git a/internal/locate/region_request_test.go b/internal/locate/region_request_test.go index a86de2a121..797b739b57 100644 --- a/internal/locate/region_request_test.go +++ b/internal/locate/region_request_test.go @@ -40,6 +40,7 @@ import ( "math" "math/rand" "net" + "strconv" "sync" "sync/atomic" "testing" @@ -828,3 +829,46 @@ func (s *testRegionRequestToSingleStoreSuite) TestRegionRequestSenderString() { sender.SendReqCtx(s.bo, tikvrpc.NewRequest(tikvrpc.CmdGet, &kvrpcpb.GetRequest{}), loc.Region, time.Second, tikvrpc.TiKV) s.Equal("{rpcError:, replicaSelector: }", sender.String()) } + +func (s *testRegionRequestToSingleStoreSuite) TestRegionRequestStats() { + reqStats := NewRegionRequestRuntimeStats() + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Second) + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Millisecond) + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdCop, time.Second*2) + reqStats.RecordRPCRuntimeStats(tikvrpc.CmdCop, time.Millisecond*200) + reqStats.RecordRPCErrorStats("context canceled") + reqStats.RecordRPCErrorStats("context canceled") + reqStats.RecordRPCErrorStats("region_not_found") + reqStats.Merge(NewRegionRequestRuntimeStats()) + reqStats2 := NewRegionRequestRuntimeStats() + reqStats2.Merge(reqStats.Clone()) + expecteds := []string{ + // Since map iteration order is random, we need to check all possible orders. + "Get:{num_rpc:2, total_time:1s},Cop:{num_rpc:2, total_time:2.2s}, rpc_errors:{region_not_found:1, context canceled:2}", + "Get:{num_rpc:2, total_time:1s},Cop:{num_rpc:2, total_time:2.2s}, rpc_errors:{context canceled:2, region_not_found:1}", + "Cop:{num_rpc:2, total_time:2.2s},Get:{num_rpc:2, total_time:1s}, rpc_errors:{context canceled:2, region_not_found:1}", + "Cop:{num_rpc:2, total_time:2.2s},Get:{num_rpc:2, total_time:1s}, rpc_errors:{region_not_found:1, context canceled:2}", + } + s.Contains(expecteds, reqStats.String()) + s.Contains(expecteds, reqStats2.String()) + for i := 0; i < 50; i++ { + reqStats.RecordRPCErrorStats("err_" + strconv.Itoa(i)) + } + s.Regexp("{.*err_.*:1.*, other_error:36}", reqStats.RequestErrorStats.String()) + s.Regexp(".*num_rpc.*total_time.*, rpc_errors:{.*err.*, other_error:36}", reqStats.String()) + + access := &ReplicaAccessStats{} + access.recordReplicaAccessInfo(true, false, 1, 2, "data_not_ready") + access.recordReplicaAccessInfo(false, false, 3, 4, "not_leader") + access.recordReplicaAccessInfo(false, true, 5, 6, "server_is_Busy") + s.Equal("{stale_read, peer:1, store:2, err:data_not_ready}, {peer:3, store:4, err:not_leader}, {replica_read, peer:5, store:6, err:server_is_Busy}", access.String()) + for i := 0; i < 20; i++ { + access.recordReplicaAccessInfo(false, false, 5+uint64(i)%2, 6, "server_is_Busy") + } + expecteds = []string{ + // Since map iteration order is random, we need to check all possible orders. + "{stale_read, peer:1, store:2, err:data_not_ready}, {peer:3, store:4, err:not_leader}, {replica_read, peer:5, store:6, err:server_is_Busy}, {peer:5, store:6, err:server_is_Busy}, {peer:6, store:6, err:server_is_Busy}, overflow_count:{{peer:5, error_stats:{server_is_Busy:9}}, {peer:6, error_stats:{server_is_Busy:9}}}", + "{stale_read, peer:1, store:2, err:data_not_ready}, {peer:3, store:4, err:not_leader}, {replica_read, peer:5, store:6, err:server_is_Busy}, {peer:5, store:6, err:server_is_Busy}, {peer:6, store:6, err:server_is_Busy}, overflow_count:{{peer:6, error_stats:{server_is_Busy:9}}, {peer:5, error_stats:{server_is_Busy:9}}}", + } + s.Contains(expecteds, access.String()) +} diff --git a/metrics/metrics.go b/metrics/metrics.go index f5e8827b07..6d6c007203 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -50,6 +50,7 @@ var ( TiKVCoprocessorHistogram *prometheus.HistogramVec TiKVLockResolverCounter *prometheus.CounterVec TiKVRegionErrorCounter *prometheus.CounterVec + TiKVRPCErrorCounter *prometheus.CounterVec TiKVTxnWriteKVCountHistogram *prometheus.HistogramVec TiKVTxnWriteSizeHistogram *prometheus.HistogramVec TiKVRawkvCmdHistogram *prometheus.HistogramVec @@ -221,7 +222,16 @@ func initMetrics(namespace, subsystem string, constLabels prometheus.Labels) { Name: "region_err_total", Help: "Counter of region errors.", ConstLabels: constLabels, - }, []string{LblType, LblScope}) + }, []string{LblType, LblStore}) + + TiKVRPCErrorCounter = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Namespace: namespace, + Subsystem: subsystem, + Name: "rpc_err_total", + Help: "Counter of rpc errors.", + ConstLabels: constLabels, + }, []string{LblType, LblStore}) TiKVTxnWriteKVCountHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ @@ -805,6 +815,7 @@ func RegisterMetrics() { prometheus.MustRegister(TiKVCoprocessorHistogram) prometheus.MustRegister(TiKVLockResolverCounter) prometheus.MustRegister(TiKVRegionErrorCounter) + prometheus.MustRegister(TiKVRPCErrorCounter) prometheus.MustRegister(TiKVTxnWriteKVCountHistogram) prometheus.MustRegister(TiKVTxnWriteSizeHistogram) prometheus.MustRegister(TiKVRawkvCmdHistogram) diff --git a/tikv/region.go b/tikv/region.go index 7753d4478b..52da6b6bfa 100644 --- a/tikv/region.go +++ b/tikv/region.go @@ -135,11 +135,6 @@ const ( NullspaceID KeyspaceID = apicodec.NullspaceID ) -// RecordRegionRequestRuntimeStats records request runtime stats. -func RecordRegionRequestRuntimeStats(stats map[tikvrpc.CmdType]*locate.RPCRuntimeStats, cmd tikvrpc.CmdType, d time.Duration) { - locate.RecordRegionRequestRuntimeStats(stats, cmd, d) -} - // Store contains a kv process's address. type Store = locate.Store @@ -190,7 +185,7 @@ func WithMatchStores(stores []uint64) StoreSelectorOption { } // NewRegionRequestRuntimeStats returns a new RegionRequestRuntimeStats. -func NewRegionRequestRuntimeStats() RegionRequestRuntimeStats { +func NewRegionRequestRuntimeStats() *RegionRequestRuntimeStats { return locate.NewRegionRequestRuntimeStats() } diff --git a/txnkv/txnsnapshot/client_helper.go b/txnkv/txnsnapshot/client_helper.go index bd9278069d..6944c75536 100644 --- a/txnkv/txnsnapshot/client_helper.go +++ b/txnkv/txnsnapshot/client_helper.go @@ -62,7 +62,7 @@ type ClientHelper struct { committedLocks *util.TSSet client client.Client resolveLite bool - locate.RegionRequestRuntimeStats + Stats *locate.RegionRequestRuntimeStats } // NewClientHelper creates a helper instance. @@ -81,7 +81,7 @@ func NewClientHelper(store kvstore, resolvedLocks *util.TSSet, committedLocks *u func (ch *ClientHelper) ResolveLocksWithOpts(bo *retry.Backoffer, opts txnlock.ResolveLocksOptions) (txnlock.ResolveLockResult, error) { if ch.Stats != nil { defer func(start time.Time) { - locate.RecordRegionRequestRuntimeStats(ch.Stats, tikvrpc.CmdResolveLock, time.Since(start)) + ch.Stats.RecordRPCRuntimeStats(tikvrpc.CmdResolveLock, time.Since(start)) }(time.Now()) } opts.ForRead = true @@ -103,7 +103,7 @@ func (ch *ClientHelper) ResolveLocksWithOpts(bo *retry.Backoffer, opts txnlock.R func (ch *ClientHelper) ResolveLocks(bo *retry.Backoffer, callerStartTS uint64, locks []*txnlock.Lock) (int64, error) { if ch.Stats != nil { defer func(start time.Time) { - locate.RecordRegionRequestRuntimeStats(ch.Stats, tikvrpc.CmdResolveLock, time.Since(start)) + ch.Stats.RecordRPCRuntimeStats(tikvrpc.CmdResolveLock, time.Since(start)) }(time.Now()) } msBeforeTxnExpired, resolvedLocks, committedLocks, err := ch.lockResolver.ResolveLocksForRead(bo, callerStartTS, locks, ch.resolveLite) diff --git a/txnkv/txnsnapshot/snapshot.go b/txnkv/txnsnapshot/snapshot.go index f40e6bc984..58c3a755fb 100644 --- a/txnkv/txnsnapshot/snapshot.go +++ b/txnkv/txnsnapshot/snapshot.go @@ -408,7 +408,7 @@ func (s *KVSnapshot) batchGetSingleRegion(bo *retry.Backoffer, batch batchKeys, cli := NewClientHelper(s.store, &s.resolvedLocks, &s.committedLocks, false) s.mu.RLock() if s.mu.stats != nil { - cli.Stats = make(map[tikvrpc.CmdType]*locate.RPCRuntimeStats) + cli.Stats = locate.NewRegionRequestRuntimeStats() defer func() { s.mergeRegionRequestStats(cli.Stats) }() @@ -657,7 +657,7 @@ func (s *KVSnapshot) get(ctx context.Context, bo *retry.Backoffer, k []byte) ([] cli := NewClientHelper(s.store, &s.resolvedLocks, &s.committedLocks, true) s.mu.RLock() if s.mu.stats != nil { - cli.Stats = make(map[tikvrpc.CmdType]*locate.RPCRuntimeStats) + cli.Stats = locate.NewRegionRequestRuntimeStats() defer func() { s.mergeRegionRequestStats(cli.Stats) }() @@ -1080,25 +1080,17 @@ func (s *KVSnapshot) recordBackoffInfo(bo *retry.Backoffer) { } } -func (s *KVSnapshot) mergeRegionRequestStats(stats map[tikvrpc.CmdType]*locate.RPCRuntimeStats) { +func (s *KVSnapshot) mergeRegionRequestStats(rpcStats *locate.RegionRequestRuntimeStats) { s.mu.Lock() defer s.mu.Unlock() if s.mu.stats == nil { return } - if s.mu.stats.rpcStats.Stats == nil { - s.mu.stats.rpcStats.Stats = stats + if s.mu.stats.rpcStats == nil { + s.mu.stats.rpcStats = rpcStats return } - for k, v := range stats { - stat, ok := s.mu.stats.rpcStats.Stats[k] - if !ok { - s.mu.stats.rpcStats.Stats[k] = v - continue - } - stat.Count += v.Count - stat.Consume += v.Consume - } + s.mu.stats.rpcStats.Merge(rpcStats) } // SetKVReadTimeout sets timeout for individual KV read operations under this snapshot @@ -1133,7 +1125,7 @@ func (s *KVSnapshot) SetPipelined(ts uint64) { // SnapshotRuntimeStats records the runtime stats of snapshot. type SnapshotRuntimeStats struct { - rpcStats locate.RegionRequestRuntimeStats + rpcStats *locate.RegionRequestRuntimeStats backoffSleepMS map[string]int backoffTimes map[string]int scanDetail *util.ScanDetail @@ -1143,11 +1135,9 @@ type SnapshotRuntimeStats struct { // Clone implements the RuntimeStats interface. func (rs *SnapshotRuntimeStats) Clone() *SnapshotRuntimeStats { - newRs := SnapshotRuntimeStats{rpcStats: locate.NewRegionRequestRuntimeStats()} - if rs.rpcStats.Stats != nil { - for k, v := range rs.rpcStats.Stats { - newRs.rpcStats.Stats[k] = v - } + newRs := SnapshotRuntimeStats{} + if rs.rpcStats != nil { + newRs.rpcStats = rs.rpcStats.Clone() } if len(rs.backoffSleepMS) > 0 { newRs.backoffSleepMS = make(map[string]int) @@ -1177,9 +1167,9 @@ func (rs *SnapshotRuntimeStats) Clone() *SnapshotRuntimeStats { // Merge implements the RuntimeStats interface. func (rs *SnapshotRuntimeStats) Merge(other *SnapshotRuntimeStats) { - if other.rpcStats.Stats != nil { - if rs.rpcStats.Stats == nil { - rs.rpcStats.Stats = make(map[tikvrpc.CmdType]*locate.RPCRuntimeStats, len(other.rpcStats.Stats)) + if other.rpcStats != nil { + if rs.rpcStats == nil { + rs.rpcStats = locate.NewRegionRequestRuntimeStats() } rs.rpcStats.Merge(other.rpcStats) } @@ -1202,7 +1192,9 @@ func (rs *SnapshotRuntimeStats) Merge(other *SnapshotRuntimeStats) { // String implements fmt.Stringer interface. func (rs *SnapshotRuntimeStats) String() string { var buf bytes.Buffer - buf.WriteString(rs.rpcStats.String()) + if rs.rpcStats != nil { + buf.WriteString(rs.rpcStats.String()) + } for k, v := range rs.backoffTimes { if buf.Len() > 0 { buf.WriteByte(',') @@ -1226,11 +1218,11 @@ func (rs *SnapshotRuntimeStats) String() string { // GetCmdRPCCount returns the count of the corresponding kind of rpc requests func (rs *SnapshotRuntimeStats) GetCmdRPCCount(cmd tikvrpc.CmdType) int64 { - if rs.rpcStats.Stats == nil { + if rs.rpcStats == nil || len(rs.rpcStats.RPCStats) == 0 { return 0 } - stats, ok := rs.rpcStats.Stats[cmd] + stats, ok := rs.rpcStats.RPCStats[cmd] if !ok { return 0 } diff --git a/txnkv/txnsnapshot/test_probe.go b/txnkv/txnsnapshot/test_probe.go index 8900243d7b..0d06769eb3 100644 --- a/txnkv/txnsnapshot/test_probe.go +++ b/txnkv/txnsnapshot/test_probe.go @@ -18,7 +18,6 @@ import ( "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/tikv/client-go/v2/config/retry" "github.com/tikv/client-go/v2/internal/locate" - "github.com/tikv/client-go/v2/tikvrpc" ) // SnapshotProbe exposes some snapshot utilities for testing purpose. @@ -27,8 +26,8 @@ type SnapshotProbe struct { } // MergeRegionRequestStats merges RPC runtime stats into snapshot's stats. -func (s SnapshotProbe) MergeRegionRequestStats(stats map[tikvrpc.CmdType]*locate.RPCRuntimeStats) { - s.mergeRegionRequestStats(stats) +func (s SnapshotProbe) MergeRegionRequestStats(rpcStats *locate.RegionRequestRuntimeStats) { + s.mergeRegionRequestStats(rpcStats) } // RecordBackoffInfo records backoff stats into snapshot's stats. From 52c232be3d0b5ac1a217006a35ffcf9fcb492bd5 Mon Sep 17 00:00:00 2001 From: JmPotato Date: Tue, 30 Apr 2024 16:32:54 +0800 Subject: [PATCH 21/22] Update the PD client to adopt the latest optimization (#1326) --- go.mod | 2 +- go.sum | 4 +- integration_tests/go.mod | 39 +++---- integration_tests/go.sum | 246 +++++++++++---------------------------- 4 files changed, 91 insertions(+), 200 deletions(-) diff --git a/go.mod b/go.mod index 4c0992c407..3c581158e4 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/prometheus/client_model v0.5.0 github.com/stretchr/testify v1.8.2 github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a - github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 + github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3 github.com/twmb/murmur3 v1.1.3 go.etcd.io/etcd/api/v3 v3.5.10 go.etcd.io/etcd/client/v3 v3.5.10 diff --git a/go.sum b/go.sum index 93ea561576..c8cdafa491 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW93SG+q0F8KI+yFrcIDT4c/RNoc4= github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM= -github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 h1:qiIt9AyEUW5yabTbCIgwxSMKi3p8ZE/YAk1Z6+fJq8M= -github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31/go.mod h1:Z/QAgOt29zvwBTd0H6pdx45VO6KRNc/O/DzGkVmSyZg= +github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3 h1:1MReqAoXNPyTarVZ3cihghWrmczF6yj+tmBLkj7g9Oc= +github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3/go.mod h1:FaQnRpX8ZXMR8pih4xNdNxqDrwZvpu7GMsJKDZyF9pk= github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/integration_tests/go.mod b/integration_tests/go.mod index b90a09e183..a8e323d75d 100644 --- a/integration_tests/go.mod +++ b/integration_tests/go.mod @@ -7,26 +7,26 @@ require ( github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754 - github.com/pingcap/tidb v1.1.0-beta.0.20240312154839-cd6dbc2af910 + github.com/pingcap/tidb v1.1.0-beta.0.20240430081142-7481aa6d0b8b github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.14.1 - github.com/tikv/client-go/v2 v2.0.8-0.20240313022320-d59fea5757db - github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 + github.com/tikv/client-go/v2 v2.0.8-0.20240429075632-31a502b9ba4d + github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3 go.uber.org/goleak v1.3.0 ) require ( github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/BurntSushi/toml v1.3.2 // indirect + github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudfoundry/gosigar v1.3.6 // indirect - github.com/cockroachdb/errors v1.8.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect - github.com/cockroachdb/redact v1.0.8 // indirect - github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64 // indirect github.com/coocood/freecache v1.2.1 // indirect github.com/coocood/rtutil v0.0.0-20190304133409-c84515f646f2 // indirect @@ -39,6 +39,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dolthub/maphash v0.1.0 // indirect github.com/dolthub/swiss v0.2.1 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect github.com/go-ldap/ldap/v3 v3.4.4 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -51,7 +52,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/influxdata/tdigest v0.0.1 // indirect github.com/jellydator/ttlcache/v3 v3.0.1 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid v1.3.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -66,18 +67,18 @@ require ( github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 // indirect github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d // indirect github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5 // indirect - github.com/pingcap/tidb/pkg/parser v0.0.0-20240312154839-cd6dbc2af910 // indirect + github.com/pingcap/tidb/pkg/parser v0.0.0-20240430081142-7481aa6d0b8b // indirect github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/prometheus/client_golang v1.19.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect github.com/prometheus/procfs v0.13.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/shirou/gopsutil/v3 v3.24.1 // indirect + github.com/shirou/gopsutil/v3 v3.24.2 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect @@ -88,7 +89,7 @@ require ( github.com/twmb/murmur3 v1.1.6 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.etcd.io/etcd/api/v3 v3.5.12 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect go.etcd.io/etcd/client/v3 v3.5.12 // indirect @@ -96,13 +97,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sync v0.6.0 // indirect + golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.19.0 // indirect + golang.org/x/tools v0.20.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/grpc v1.63.2 // indirect @@ -114,7 +115,5 @@ require ( replace ( github.com/go-ldap/ldap/v3 => github.com/YangKeao/ldap/v3 v3.4.5-0.20230421065457-369a3bab1117 - github.com/pingcap/tidb => github.com/JmPotato/tidb v1.1.0-beta.0.20240319075521-d7dddea5fad2 - github.com/pingcap/tidb/pkg/parser => github.com/JmPotato/tidb/pkg/parser v0.0.0-20240319075521-d7dddea5fad2 github.com/tikv/client-go/v2 => ../ ) diff --git a/integration_tests/go.sum b/integration_tests/go.sum index c8081dbde4..b505a44511 100644 --- a/integration_tests/go.sum +++ b/integration_tests/go.sum @@ -9,7 +9,7 @@ cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= @@ -25,28 +25,20 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= -github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/JmPotato/tidb v1.1.0-beta.0.20240319075521-d7dddea5fad2 h1:MSd3D9y4XDeHmMGs/r4lkhLOSkZ5kLyujKB3UGtFeuc= -github.com/JmPotato/tidb v1.1.0-beta.0.20240319075521-d7dddea5fad2/go.mod h1:or1haYr3yUaxgnrK5Sqm5Ha3R7+XqOCVuMI5i1Y9gKk= -github.com/JmPotato/tidb/pkg/parser v0.0.0-20240319075521-d7dddea5fad2 h1:g4TkxTGPUy/zDGnKc71RR+r3uXosTHpcuvOkFyD7PXs= -github.com/JmPotato/tidb/pkg/parser v0.0.0-20240319075521-d7dddea5fad2/go.mod h1:c/4la2yfv1vBYvtIG8WCDyDinLMDIUC5+zLRHiafY+Y= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/YangKeao/ldap/v3 v3.4.5-0.20230421065457-369a3bab1117 h1:+OqGGFc2YHFd82aSHmjlILVt1t4JWJjrNIfV8cVEPow= github.com/YangKeao/ldap/v3 v3.4.5-0.20230421065457-369a3bab1117/go.mod h1:bMGIq3AGbytbaMwf8wdv5Phdxz0FWHTIYMSzyrYgnQs= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/aliyun/alibaba-cloud-sdk-go v1.61.1581 h1:Q/yk4z/cHUVZfgTqtD09qeYBxHwshQAjVRX73qs8UH0= @@ -58,7 +50,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI= github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -73,27 +64,24 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA= github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudfoundry/gosigar v1.3.6 h1:gIc08FbB3QPb+nAQhINIK/qhf5REKkY0FTGgRGXkcVc= github.com/cloudfoundry/gosigar v1.3.6/go.mod h1:lNWstu5g5gw59O09Y+wsMNFzBSnU8a0u+Sfx4dq360E= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= -github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20220415182917-06c9d3be25b3 h1:snjwkhKc/ZtYIC/hg6UoT5PrhXcZmCsaB+z0bonMDcU= -github.com/cockroachdb/pebble v0.0.0-20220415182917-06c9d3be25b3/go.mod h1:buxOO9GBtOcq1DiXDpIPYrmxY020K2A8lOrwno5FetU= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64 h1:W1SHiII3e0jVwvaQFglwu3kS9NLxOeTpvik7MbKCyuQ= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64/go.mod h1:F86k/6c7aDUdwSUevnLpHS/3Q9hzYCE99jGk2xsHnt0= github.com/coocood/freecache v1.2.1 h1:/v1CqMq45NFH9mp/Pt142reundeBM0dVUD3osQBeu/U= @@ -119,10 +107,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -136,40 +122,33 @@ github.com/dolthub/swiss v0.2.1/go.mod h1:8AhKZZ1HK7g18j7v7k6c5cYIGEZJcPn0ARsai8 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-asn1-ber/asn1-ber v1.5.4 h1:vXT6d/FNDiELJnLb6hGNa309LMsrCoYFvpwHDF0+Y1A= github.com/go-asn1-ber/asn1-ber v1.5.4/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -178,25 +157,20 @@ github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5 github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v0.0.0-20180717141946-636bf0302bc9/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -209,29 +183,20 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240117000934-35fc243c5815 h1:WzfWbQz/Ze8v6l++GGbGNFZnUShVpP/0xffCPLL+ax8= @@ -245,10 +210,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfF github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -259,20 +222,12 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY= github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jedib0t/go-pretty/v6 v6.2.2 h1:o3McN0rQ4X+IU+HduppSp9TwRdGLRW2rhJXy9CJaCRw= github.com/jedib0t/go-pretty/v6 v6.2.2/go.mod h1:+nE9fyyHGil+PuISTCrp7avEdo6bqoMwqZnuiK2r2a0= github.com/jellydator/ttlcache/v3 v3.0.1 h1:cHgCSMS7TdQcoprXnWUptJZzyFsqs18Lt8VVhRuZYVU= @@ -287,27 +242,16 @@ github.com/joho/sqltocsv v0.0.0-20210428211105-a6d6801d59df h1:Zrb0IbuLOGHL7nrO2 github.com/joho/sqltocsv v0.0.0-20210428211105-a6d6801d59df/go.mod h1:mAVCUAYtW9NG31eB30umMSLKcDt6mCUWSjoSn5qBh0k= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= -github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= -github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= -github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= @@ -323,8 +267,6 @@ github.com/ks3sdklib/aws-sdk-go v1.2.9 h1:Eg0fM56r4Gjp9PiK1Bg9agJUxCAWCk236qq9DI github.com/ks3sdklib/aws-sdk-go v1.2.9/go.mod h1:xBNbOrxSnd36AQpZ8o99mGGu+blblUd9rI0MKGmeufo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= @@ -341,32 +283,19 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2 github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a h1:N9zuLhTvBSRt0gWSiJswwQ2HqDmtX/ZCDJURnKUt1Ik= github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= -github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncw/directio v1.0.4/go.mod h1:CKGdcN7StAaqjT7Qack3lAXeX4pjnyc46YeqZH1yWVY= github.com/ncw/directio v1.0.5 h1:JSUBhdjEvVaJvOoyPAbcW0fnd0tvRXD76wEfZ1KcQz4= github.com/ncw/directio v1.0.5/go.mod h1:rX/pKEYkOXBGOggmcyJeJGloCkleSvphPx2eV3t6ROk= @@ -374,18 +303,13 @@ github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 h1:7KAv7KMGTTqSmYZtNdc github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7/go.mod h1:iWMfgwqYW+e8n5lC/jjNEhwcjbRDpl5NT7n2h+4UNcI= github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef h1:K0Fn+DoFqNqktdZtdV3bPQ/0cuYh2H4rkg0tytX/07k= github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo6LNmIvEWzsW1hbBQfpUO4JWnuQRmva8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/ninedraft/israce v0.0.3 h1:F/Y1u6OlvgE75Syv1WbBatyg3CjGCdxLojLE7ydv2yE= github.com/ninedraft/israce v0.0.3/go.mod h1:4L1ITFl340650ZmexVbUcBwG18ozlWiMe47pltZAmn4= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/opentracing/basictracer-go v1.1.0 h1:Oa1fTSBvAl8pa3U+IJYqrKm0NALwH9OsgwOqDv4xJW0= @@ -421,6 +345,10 @@ github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d h1:y3EueKVfVykdpTyfU github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d/go.mod h1:ORfBOFp1eteu2odzsyaxI+b8TzJwgjwyQcGhI+9SfEA= github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5 h1:T4pXRhBflzDeAhmOQHNPRRogMYxP13V7BkYw3ZsoSfE= github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5/go.mod h1:rlimy0GcTvjiJqvD5mXTRr8O2eNZPBrcUgiWVYp9530= +github.com/pingcap/tidb v1.1.0-beta.0.20240430081142-7481aa6d0b8b h1:LkEDqQkZG/8R+AD9Mw+hT1dRu07hpeZwxwmSaMwTdfM= +github.com/pingcap/tidb v1.1.0-beta.0.20240430081142-7481aa6d0b8b/go.mod h1:mQSL9OzAUogkKtCTEM+SNiVfWh0pZcvuZ/uA2GnNHes= +github.com/pingcap/tidb/pkg/parser v0.0.0-20240430081142-7481aa6d0b8b h1:5XlLqwwcl9HHfyUBmMKTXE61dN6dr/KI+cHY15+Ezjs= +github.com/pingcap/tidb/pkg/parser v0.0.0-20240430081142-7481aa6d0b8b/go.mod h1:c/4la2yfv1vBYvtIG8WCDyDinLMDIUC5+zLRHiafY+Y= github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50 h1:fVNBE06Rjec+EIHaYAKAHa/bIt5lnu3Zh9O6kV7ZAdg= github.com/pingcap/tipb v0.0.0-20240318032315-55a7867ddd50/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -440,11 +368,11 @@ github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7km github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= @@ -456,35 +384,28 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/scalalang2/golang-fifo v0.1.5 h1:cl70TQhlMGGpI2DZGcr+7/GFTJOjHMeor0t7wynEEoA= -github.com/scalalang2/golang-fifo v0.1.5/go.mod h1:IK3OZBg7iHbVdQVGPDjcW1MWPb6JcWjaS/w0iRBS8gs= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil/v3 v3.21.12/go.mod h1:BToYZVTlSVlfazpDDYFnsVZLaoRG+g8ufT6fPQLdJzA= -github.com/shirou/gopsutil/v3 v3.24.1 h1:R3t6ondCEvmARp3wxODhXMTLC/klMa87h2PHUw5m7QI= -github.com/shirou/gopsutil/v3 v3.24.1/go.mod h1:UU7a2MSBQa+kW1uuDq8DeEBS8kmrnQwsv2b5O513rwU= +github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y= +github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c h1:aqg5Vm5dwtvL+YgDpBcK1ITf3o96N/K7/wsRXQnUTEs= github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c/go.mod h1:owqhoLW1qZoYLZzLnBw+QkPP9WZnjlSWihhxAJC1+/M= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -527,8 +448,8 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 h1:qiIt9AyEUW5yabTbCIgwxSMKi3p8ZE/YAk1Z6+fJq8M= -github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31/go.mod h1:Z/QAgOt29zvwBTd0H6pdx45VO6KRNc/O/DzGkVmSyZg= +github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3 h1:1MReqAoXNPyTarVZ3cihghWrmczF6yj+tmBLkj7g9Oc= +github.com/tikv/pd/client v0.0.0-20240430080403-1679dbca25b3/go.mod h1:FaQnRpX8ZXMR8pih4xNdNxqDrwZvpu7GMsJKDZyF9pk= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= @@ -543,36 +464,23 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vbauerster/mpb/v7 v7.5.3 h1:BkGfmb6nMrrBQDFECR/Q7RkKCw7ylMetCb4079CGs4w= github.com/vbauerster/mpb/v7 v7.5.3/go.mod h1:i+h4QY6lmLvBNK2ah1fSreiw3ajskRlBp9AhY/PnuOE= github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f h1:9DDCDwOyEy/gId+IEMrFHLuQ5R/WV0KNxWLler8X2OY= github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f/go.mod h1:8sdOQnirw1PrcnTJYkmW1iOHtUmblMmGdUOHyWYycLI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xitongsys/parquet-go v1.5.5-0.20201110004701-b09c49d6d457 h1:tBbuFCtyJNKT+BFAv6qjvTFpVdy97IYNaBwGUXifIUs= github.com/xitongsys/parquet-go v1.5.5-0.20201110004701-b09c49d6d457/go.mod h1:pheqtXeHQFzxJk45lRQ0UIGIivKnLXvialZSFWs81A8= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c= @@ -643,7 +551,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -651,15 +558,24 @@ golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= -golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -668,19 +584,13 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -696,30 +606,22 @@ golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -737,7 +639,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -747,7 +649,6 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -761,14 +662,13 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -780,23 +680,25 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -808,7 +710,6 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= @@ -819,26 +720,17 @@ google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9 h1:ATnmU8nL2NfIyTSiBvJVDIDIr3qBmeW+c7z7XU21eWs= google.golang.org/grpc/examples v0.0.0-20231221225426-4f03f3ff32c9/go.mod h1:j5uROIAAgi3YmtiETMt1LW0d/lHqQ7wwrIY4uGRXLQ4= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= @@ -847,7 +739,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -866,6 +757,7 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= From 6cb0704fce51e215c3012d94fff27bd440e7137e Mon Sep 17 00:00:00 2001 From: you06 Date: Tue, 30 Apr 2024 23:52:41 +0900 Subject: [PATCH 22/22] fail pipelined dml when max ttl exceeded (#1329) Signed-off-by: you06 Co-authored-by: ekexium --- integration_tests/pipelined_memdb_test.go | 40 +++++++++++++++++++++++ txnkv/transaction/2pc.go | 5 +++ 2 files changed, 45 insertions(+) diff --git a/integration_tests/pipelined_memdb_test.go b/integration_tests/pipelined_memdb_test.go index 3d6c2b4790..cfc2401301 100644 --- a/integration_tests/pipelined_memdb_test.go +++ b/integration_tests/pipelined_memdb_test.go @@ -26,6 +26,7 @@ import ( "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/pkg/store/mockstore/unistore" "github.com/stretchr/testify/suite" + "github.com/tikv/client-go/v2/config" "github.com/tikv/client-go/v2/config/retry" tikverr "github.com/tikv/client-go/v2/error" "github.com/tikv/client-go/v2/oracle" @@ -466,3 +467,42 @@ func (s *testPipelinedMemDBSuite) TestPipelinedDMLFailedByPKRollback() { s.NotNil(err) s.ErrorContains(err, "ttl manager is closed") } + +func (s *testPipelinedMemDBSuite) TestPipelinedDMLFailedByPKMaxTTLExceeded() { + originManagedTTLVal := atomic.LoadUint64(&transaction.ManagedLockTTL) + originMaxPipelinedTxnTTL := atomic.LoadUint64(&transaction.MaxPipelinedTxnTTL) + atomic.StoreUint64(&transaction.ManagedLockTTL, 100) // set to 100ms + atomic.StoreUint64(&transaction.MaxPipelinedTxnTTL, 200) // set to 200ms + updateGlobalConfig(func(conf *config.Config) { + conf.MaxTxnTTL = 200 // set to 200ms + }) + defer func() { + atomic.StoreUint64(&transaction.ManagedLockTTL, originManagedTTLVal) + atomic.StoreUint64(&transaction.MaxPipelinedTxnTTL, originMaxPipelinedTxnTTL) + restoreGlobalConfFunc() + }() + + txn, err := s.store.Begin(tikv.WithPipelinedMemDB()) + s.Nil(err) + txn.Set([]byte("key1"), []byte("value1")) + txnProbe := transaction.TxnProbe{KVTxn: txn} + flushed, err := txnProbe.GetMemBuffer().Flush(true) + s.Nil(err) + s.True(flushed) + s.Nil(txn.GetMemBuffer().FlushWait()) + s.Equal(txnProbe.GetCommitter().GetPrimaryKey(), []byte("key1")) + + s.True(txnProbe.GetCommitter().IsTTLRunning()) + + s.Eventuallyf(func() bool { + return !txnProbe.GetCommitter().IsTTLRunning() + }, 5*time.Second, 100*time.Millisecond, "ttl manager should stop after max ttl") + + txn.Set([]byte("key2"), []byte("value2")) + flushed, err = txn.GetMemBuffer().Flush(true) + s.Nil(err) + s.True(flushed) + err = txn.GetMemBuffer().FlushWait() + s.NotNil(err) + s.ErrorContains(err, "ttl manager is closed") +} diff --git a/txnkv/transaction/2pc.go b/txnkv/transaction/2pc.go index 75741bfdc6..a772a0e8e7 100644 --- a/txnkv/transaction/2pc.go +++ b/txnkv/transaction/2pc.go @@ -1229,6 +1229,11 @@ func keepAlive( if c.isPessimistic && lockCtx != nil && lockCtx.LockExpired != nil { atomic.StoreUint32(lockCtx.LockExpired, 1) } + if isPipelinedTxn { + // the pipelined txn can last a long time after max ttl exceeded. + // if we don't stop it, it may fail when committing the primary key with high probability. + tm.close() + } return }