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

cherry-pick important features to release-4.0 branch #622

Merged
merged 9 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package cmd
import (
"github.com/pingcap/log"
"github.com/pingcap/tidb/ddl"
"github.com/pingcap/tidb/session"
"github.com/spf13/cobra"
"go.uber.org/zap"

Expand Down Expand Up @@ -56,8 +55,6 @@ func NewBackupCommand() *cobra.Command {

// Do not run ddl worker in BR.
ddl.RunWorker = false
// Do not run stat worker in BR.
session.DisableStats4Test()

summary.SetUnit(summary.BackupUnit)
return nil
Expand Down
7 changes: 4 additions & 3 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"go.uber.org/zap"

berrors "github.com/pingcap/br/pkg/errors"
"github.com/pingcap/br/pkg/logutil"
"github.com/pingcap/br/pkg/restore"
"github.com/pingcap/br/pkg/rtree"
"github.com/pingcap/br/pkg/task"
Expand Down Expand Up @@ -106,8 +107,8 @@ func newCheckSumCommand() *cobra.Command {
zap.Uint64("totalBytes", file.GetTotalBytes()),
zap.Uint64("startVersion", file.GetStartVersion()),
zap.Uint64("endVersion", file.GetEndVersion()),
zap.Stringer("startKey", utils.WrapKey(file.GetStartKey())),
zap.Stringer("endKey", utils.WrapKey(file.GetEndKey())),
zap.Stringer("startKey", logutil.WrapKey(file.GetStartKey())),
zap.Stringer("endKey", logutil.WrapKey(file.GetEndKey())),
)

var data []byte
Expand Down Expand Up @@ -186,7 +187,7 @@ func newBackupMetaCommand() *cobra.Command {
log.Error(
"file ranges overlapped",
zap.Stringer("out", out),
utils.ZapFile(file),
logutil.File(file),
)
}
}
Expand Down
4 changes: 0 additions & 4 deletions cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package cmd

import (
"github.com/pingcap/log"
"github.com/pingcap/tidb/session"
"github.com/spf13/cobra"
"go.uber.org/zap"

Expand Down Expand Up @@ -82,9 +81,6 @@ func NewRestoreCommand() *cobra.Command {
utils.LogBRInfo()
task.LogArguments(c)

// Do not run stat worker in BR.
session.DisableStats4Test()

summary.SetUnit(summary.RestoreUnit)
return nil
},
Expand Down
61 changes: 28 additions & 33 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ version: '3.2'

services:
control:
image: control:latest
image: control:nightly
build:
context: .
dockerfile: ./docker/Dockerfile
volumes:
- ./docker/data:/data
- ./docker/logs:/tmp
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/tmp
- /tmp/br/docker/logs:/logs
- ./bin:/go/src/github.com/pingcap/br/bin
command: -c "/usr/bin/tail -f /dev/null"
depends_on:
- "tidb"
Expand All @@ -19,13 +21,13 @@ services:
- ./docker/minio.env

pd0:
image: pingcap/pd:latest
image: pingcap/pd:nightly
ports:
- "2379"
volumes:
- ./docker/config/pd.toml:/pd.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --name=pd0
- --client-urls=http://0.0.0.0:2379
Expand All @@ -45,11 +47,11 @@ services:
restart: on-failure

tikv0:
image: pingcap/tikv:latest
image: pingcap/tikv:nightly
volumes:
- ./docker/config/tikv.toml:/tikv.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv0:20160
Expand All @@ -70,11 +72,11 @@ services:
- ./docker/minio.env

tikv1:
image: pingcap/tikv:latest
image: pingcap/tikv:nightly
volumes:
- ./docker/config/tikv.toml:/tikv.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv1:20160
Expand All @@ -95,11 +97,11 @@ services:
- ./docker/minio.env

tikv2:
image: pingcap/tikv:latest
image: pingcap/tikv:nightly
volumes:
- ./docker/config/tikv.toml:/tikv.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv2:20160
Expand All @@ -120,11 +122,11 @@ services:
- ./docker/minio.env

tikv3:
image: pingcap/tikv:latest
image: pingcap/tikv:nightly
volumes:
- ./docker/config/tikv.toml:/tikv.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv3:20160
Expand All @@ -145,11 +147,11 @@ services:
- ./docker/minio.env

tikv4:
image: pingcap/tikv:latest
image: pingcap/tikv:nightly
volumes:
- ./docker/config/tikv.toml:/tikv.toml:ro
- ./docker/data:/data
- ./docker/logs:/logs
- /tmp/br/docker/data:/data
- /tmp/br/docker/logs:/logs
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv4:20160
Expand All @@ -170,13 +172,13 @@ services:
- ./docker/minio.env

tidb:
image: pingcap/tidb:latest
image: pingcap/tidb:nightly
ports:
- "4000:4000"
- "10080:10080"
- "4000"
- "10080"
volumes:
- ./docker/config/tidb.toml:/tidb.toml:ro
- ./docker/logs:/logs
- /tmp/br/docker/logs:/logs
command:
- --store=tikv
- --path=pd0:2379
Expand All @@ -202,15 +204,8 @@ services:
ports:
- 24927:24927
volumes:
- ./docker/data/s3:/data/s3
- /tmp/br/docker/data/s3:/data/s3
command: server --address=:24927 /data/s3
env_file:
- ./docker/minio.env

tidb-vision:
image: pingcap/tidb-vision:latest
environment:
PD_ENDPOINT: pd0:2379
ports:
- "8010:8010"
restart: on-failure
38 changes: 0 additions & 38 deletions go.mod

This file was deleted.

33 changes: 23 additions & 10 deletions go.mod1
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,48 @@ go 1.13

require (
cloud.google.com/go/storage v1.6.0
github.com/aws/aws-sdk-go v1.35.2
github.com/HdrHistogram/hdrhistogram-go v0.9.0 // indirect
github.com/aws/aws-sdk-go v1.35.3
github.com/cheggaaa/pb/v3 v3.0.4
github.com/codahale/hdrhistogram v0.9.0 // indirect
github.com/coreos/go-semver v0.3.0
github.com/fsouza/fake-gcs-server v1.19.0
github.com/go-sql-driver/mysql v1.5.0
github.com/gogo/protobuf v1.3.1
github.com/golang/mock v1.4.4
github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf // indirect
github.com/google/btree v1.0.0
github.com/google/go-cmp v0.5.2 // indirect
github.com/google/uuid v1.1.1
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
github.com/pingcap/errors v0.11.5-0.20200917111840-a15ef68f753d
github.com/pingcap/errors v0.11.5-0.20201029093017-5a7df2af2ac7
github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce
github.com/pingcap/kvproto v0.0.0-20200927025644-73dc27044686
github.com/pingcap/log v0.0.0-20200828042413-fce0951f1463
github.com/pingcap/parser v0.0.0-20200921041333-cd2542b7a8a2
github.com/pingcap/tidb v1.1.0-beta.0.20200921082409-501466fb690d
github.com/pingcap/tidb-tools v4.0.5-0.20200820092506-34ea90c93237+incompatible
github.com/pingcap/kvproto v0.0.0-20201126113434-70db5fb4b0dc
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8
github.com/pingcap/parser v0.0.0-20201123083041-dfb0acc7c2fa
github.com/pingcap/tidb v1.1.0-beta.0.20201127015152-86582a3191b7
github.com/pingcap/tidb-tools v4.0.6-0.20200828085514-03575b185007+incompatible
github.com/pingcap/tipb v0.0.0-20200618092958-4fad48b4c8c3
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.9.1
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
github.com/tikv/pd v1.1.0-beta.0.20200910042021-254d1345be09
github.com/stretchr/testify v1.6.1 // indirect
github.com/tikv/pd v1.1.0-beta.0.20201126142458-25ab7fc3344a
github.com/uber/jaeger-lib v2.4.0+incompatible // indirect
go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b
go.uber.org/multierr v1.5.0
go.uber.org/multierr v1.6.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/exp v0.0.0-20200513190911-00229845015e // indirect
golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
google.golang.org/api v0.22.0
google.golang.org/grpc v1.27.1
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
)
Loading