From eed05a558355ef8a8ec767123ebe277aa869f1b2 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Sun, 12 Feb 2023 14:20:00 +0800 Subject: [PATCH] br: fix backup client (#41295) (#41304) ref pingcap/tidb#40404, ref pingcap/tidb#40898 --- br/pkg/backup/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/br/pkg/backup/client.go b/br/pkg/backup/client.go index b35033868ca82..7718d6d33986c 100644 --- a/br/pkg/backup/client.go +++ b/br/pkg/backup/client.go @@ -566,7 +566,7 @@ func BuildBackupRangeAndSchema( var globalAutoID int64 switch { case tableInfo.IsSequence(): - globalAutoID, err = autoIDAccess.SequenceCycle().Get() + globalAutoID, err = autoIDAccess.SequenceValue().Get() case tableInfo.IsView() || !utils.NeedAutoID(tableInfo): // no auto ID for views or table without either rowID nor auto_increment ID. default: @@ -841,7 +841,7 @@ func (bc *Client) BackupRange( } else { for _, store := range allStores { for _, label := range store.Labels { - if val, ok := replicaReadLabel[label.Key]; !ok && val == label.Value { + if val, ok := replicaReadLabel[label.Key]; ok && val == label.Value { targetStores = append(targetStores, store) // send backup push down request to stores that match replica read label targetStoreIds[store.GetId()] = struct{}{} // record store id for fine grained backup }