Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

br: Fix new collaction enable check (#33500) #33532

Merged
merged 13 commits into from
Apr 28, 2022
Prev Previous commit
Next Next commit
resolve conflict
  • Loading branch information
3pointer committed Apr 27, 2022
commit 4182afacad89731a64bf15fda175e7629691c36a
21 changes: 4 additions & 17 deletions br/pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,15 @@ func CheckRestoreDBAndTable(client *restore.Client, cfg *RestoreConfig) error {
return nil
}

<<<<<<< HEAD
=======
func CheckNewCollationEnable(
backupNewCollationEnable string,
g glue.Glue,
storage kv.Storage,
CheckRequirements bool,
) error {
if backupNewCollationEnable == "" {
if CheckRequirements {
return errors.Annotatef(berrors.ErrUnknown,
"NewCollactionEnable not found in backupmeta. "+
"if you ensure the NewCollactionEnable config of backup cluster is as same as restore cluster, "+
"use --check-requirements=false to skip")
} else {
log.Warn("no NewCollactionEnable in backup")
return nil
}
log.Warn("new_collations_enabled_on_first_bootstrap not found in backupmeta. "+
"we assume that this config is as same as backup cluster")
return nil
}

se, err := g.CreateSession(storage)
Expand All @@ -252,11 +243,7 @@ func CheckNewCollationEnable(
return nil
}

func isFullRestore(cmdName string) bool {
return cmdName == FullRestoreCmd
}

>>>>>>> 8f8dfafc1... br: Fix new collaction enable check (#33500)
// RunRestore starts a restore task inside the current goroutine.
func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConfig) error {
cfg.adjustRestoreConfig()
Expand Down Expand Up @@ -323,7 +310,7 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
return errors.Trace(versionErr)
}
}
if err = CheckNewCollationEnable(backupMeta.GetNewCollationsEnabled(), g, mgr.GetStorage(), cfg.CheckRequirements); err != nil {
if err = CheckNewCollationEnable(backupMeta.GetNewCollationsEnabled(), g, mgr.GetStorage()); err != nil {
return errors.Trace(err)
}

Expand Down
29 changes: 12 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ require (
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.3
github.com/google/btree v1.0.0
github.com/google/btree v1.0.1
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1
github.com/google/uuid v1.1.2
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/jedib0t/go-pretty/v6 v6.2.2
github.com/joho/sqltocsv v0.0.0-20210428211105-a6d6801d59df
Expand All @@ -48,28 +48,22 @@ require (
github.com/pingcap/badger v1.5.1-0.20210831093107-2f6cb8008145
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20210316064728-7acb0f0a3dfd
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00
github.com/pingcap/fn v0.0.0-20200306044125-d5540d389059
<<<<<<< HEAD
github.com/pingcap/kvproto v0.0.0-20211207042851-78a55fb8e69c
github.com/pingcap/log v0.0.0-20210906054005-afc726e70354
github.com/pingcap/sysutil v0.0.0-20211208032423-041a72e5860d
github.com/pingcap/tidb-tools v5.2.2-0.20211019062242-37a8bef2fa17+incompatible
=======
github.com/pingcap/kvproto v0.0.0-20220328072018-6e75c12dbd73
github.com/pingcap/kvproto v0.0.0-20220427102456-be1314bcb30f
github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee
github.com/pingcap/sysutil v0.0.0-20220114020952-ea68d2dbf5b4
>>>>>>> 8f8dfafc1... br: Fix new collaction enable check (#33500)
github.com/pingcap/tidb-tools v6.0.0+incompatible
github.com/pingcap/tidb/parser v0.0.0-20211011031125-9b13dc409c5e
github.com/pingcap/tipb v0.0.0-20220107024056-3b91949a18a7
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/client_golang v1.11.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.9.1
github.com/prometheus/common v0.26.0
github.com/shirou/gopsutil v3.21.3+incompatible
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/soheilhy/cmux v0.1.4
github.com/spf13/cobra v1.0.0
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
Expand All @@ -82,17 +76,18 @@ require (
github.com/xitongsys/parquet-go v1.5.5-0.20201110004701-b09c49d6d457
github.com/xitongsys/parquet-go-source v0.0.0-20200817004010-026bad9b25d0
go.etcd.io/etcd v0.5.0-alpha.5.0.20210512015243-d19fbe541bf9
go.etcd.io/etcd/tests/v3 v3.5.4 // indirect
go.uber.org/atomic v1.9.0
go.uber.org/automaxprocs v1.4.0
go.uber.org/goleak v1.1.12
go.uber.org/multierr v1.7.0
go.uber.org/zap v1.19.1
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
golang.org/x/text v0.3.7
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
golang.org/x/tools v0.1.8
google.golang.org/api v0.54.0
google.golang.org/grpc v1.40.0
Expand Down
Loading