Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
cherry pick #1356 to release-2.0 (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Dec 25, 2020
1 parent 5c2f245 commit 2bb9aa3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 33 deletions.
9 changes: 8 additions & 1 deletion dumpling/dumpling.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ func (m *Dumpling) Process(ctx context.Context, pr chan pb.ProcessResult) {
})

newCtx, cancel := context.WithCancel(ctx)
err = export.Dump(newCtx, m.dumpConfig)
var dumpling *export.Dumper
if dumpling, err = export.NewDumper(newCtx, m.dumpConfig); err == nil {
err = dumpling.Dump()
dumpling.Close()
}
cancel()

if err != nil {
Expand Down Expand Up @@ -241,6 +245,9 @@ func (m *Dumpling) constructArgs() (*export.Config, error) {
dumpConfig.Security.KeyPath = db.Security.SSLKey
}

// `true` means dumpling will release lock after working connection established
dumpConfig.TransactionalConsistency = true

extraArgs := strings.Fields(cfg.ExtraArgs)
if len(extraArgs) > 0 {
err := parseExtraArgs(&m.logger, dumpConfig, ParseArgLikeBash(extraArgs))
Expand Down
1 change: 1 addition & 0 deletions dumpling/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func parseExtraArgs(logger *log.Logger, dumpCfg *export.Config, args []string) e
dumplingFlagSet.StringVar(&dumpCfg.Security.CertPath, "cert", dumpCfg.Security.CertPath, "The path name to the client certificate file for TLS connection")
dumplingFlagSet.StringVar(&dumpCfg.Security.KeyPath, "key", dumpCfg.Security.KeyPath, "The path name to the client private key file for TLS connection")
dumplingFlagSet.BoolVar(&noLocks, "no-locks", false, "")
dumplingFlagSet.BoolVar(&dumpCfg.TransactionalConsistency, "transactional-consistency", true, "Only support transactional consistency")

err := dumplingFlagSet.Parse(args)
if err != nil {
Expand Down
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ require (
github.com/go-sql-driver/mysql v1.5.0
github.com/gogo/gateway v1.1.0
github.com/gogo/protobuf v1.3.1
github.com/golang/mock v1.4.3
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.3.4
github.com/google/uuid v1.1.1
github.com/grpc-ecosystem/grpc-gateway v1.14.3
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d
github.com/pingcap/br v5.0.0-rc.0.20201223100334-c344d1edf20c+incompatible // indirect
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
github.com/pingcap/dumpling v0.0.0-20201028073240-ac8d8f304ab3
github.com/pingcap/errors v0.11.5-0.20201029093017-5a7df2af2ac7
github.com/pingcap/dumpling v0.0.0-20201224084933-34903c7475cf
github.com/pingcap/errors v0.11.5-0.20201126102027-b0a155152ca3
github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8
github.com/pingcap/parser v0.0.0-20201123080035-8f4c6ab94e11
github.com/pingcap/tidb v1.1.0-beta.0.20201119113654-22feeb4aef75
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible
github.com/pingcap/parser v0.0.0-20201222091346-02c8ff27d0bc
github.com/pingcap/tidb v1.1.0-beta.0.20201224021059-213942149427
github.com/pingcap/tidb-tools v4.0.10-0.20201127090955-2707c97b3853+incompatible
github.com/prometheus/client_golang v1.5.1
github.com/rakyll/statik v0.1.6
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
Expand All @@ -34,7 +35,7 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20190625010220-02440ea7a285
github.com/tidwall/gjson v1.6.1
github.com/tidwall/sjson v1.1.2
github.com/tikv/pd v1.1.0-beta.0.20201119053953-51eff4c1fa05
github.com/tikv/pd v1.1.0-beta.0.20201125070607-d4b90eee0c70
github.com/unrolled/render v1.0.1
go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b
go.uber.org/zap v1.16.0
Expand Down
Loading

0 comments on commit 2bb9aa3

Please sign in to comment.