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

Release 4.0 merge master #200

Merged
merged 31 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0a43d2a
restore: merge tidb-tools/pkg/restore-util (#146)
overvenus Jan 22, 2020
3863a3a
Fixed handling for a dbName that do not exist in the backup being res…
Feb 1, 2020
6b65080
validate: fix debug meta test ci (#153)
3pointer Feb 5, 2020
0dfe82d
*: extracts runBackup/runRestore in cmd into pkg/task (#156)
kennytm Feb 10, 2020
8c97452
restore: fix restore summary log (#150)
3pointer Feb 13, 2020
008ec45
restore: enhance error handling (#152)
5kbpers Feb 13, 2020
1e1fc97
Incremental BR: support DDL (#155)
5kbpers Feb 20, 2020
4492b8f
Reduce TiDB dependencies (#158)
kennytm Feb 22, 2020
3c9d42f
go.mod: update tidb (#168)
overvenus Feb 23, 2020
028963d
BR support TLS (#161)
3pointer Feb 27, 2020
e462f80
upgrade golangci and prepare for go 1.14 (#171)
overvenus Feb 28, 2020
4657932
backup: add raw backup command (#101)
3pointer Mar 4, 2020
0a1a044
restore: speed up retry on not leader (#179)
overvenus Mar 5, 2020
09fb715
conn, restore: paginate scan regions (#165)
overvenus Mar 5, 2020
82b5016
Batch restore (#167)
overvenus Mar 6, 2020
3fc9ee2
README, docker: add quick start (#181)
overvenus Mar 7, 2020
237fe5b
*: update tidb dependency build with go1.14 (#176)
3pointer Mar 10, 2020
0672ab3
*: add license header (#182)
overvenus Mar 11, 2020
9caa6de
conn: support not shutting down the storage when closing the connecti…
kennytm Mar 11, 2020
7d59284
conn: use GetDomain to avoid some TiDB breaking changes (#186)
overvenus Mar 11, 2020
0e25496
fix check safepoint & unhide experimental features (#175)
5kbpers Mar 11, 2020
3419d8a
support backupts (#172)
3pointer Mar 12, 2020
e476c82
*: update pd deps to v4 (#184)
kennytm Mar 12, 2020
9c2bf9d
restore: support online restore (#114)
disksing Mar 13, 2020
512855d
metrics: add grafana scripts (#140)
WangXiangUSTC Mar 15, 2020
6b88e51
filter out all TiFlash nodes when retrieving lists of stores from PD …
kennytm Mar 16, 2020
156f003
Create integration test for S3 storage (#174)
kennytm Mar 16, 2020
bbedfc8
Fix summary log (#191)
3pointer Mar 16, 2020
c3d26d9
Implement Raw Restore (#104)
MyonKeminta Mar 17, 2020
6268cde
restore: remove tiflash replica before restore (#194)
5kbpers Mar 18, 2020
4ea6c1c
summary: put summary log at last (#197)
3pointer Mar 19, 2020
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
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
codecov:
require_ci_to_pass: yes

coverage:
status:
project:
default:
# Allow the coverage to drop by 3%
threshold: 3%
patch: off
1 change: 1 addition & 0 deletions .dockerignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ backupmeta
*.ngo
*.coverprofile
coverage.txt
docker/data/
docker/logs/
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ issues:
text: "Potential HTTP request made with variable url"
linters:
- gosec
- path: .go
text: "Use of weak random number generator"
# TODO Remove it.
- path: split_client.go
text: "SA1019:"
linters:
- gosec
- staticcheck
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {}
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@ Apache License
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S
LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "$(BR_PKG)/pkg/utils.BRGitBranch=$(shell git rev-parse --abbrev-ref HEAD)"

all: check test build
ifeq ("$(WITH_RACE)", "1")
RACEFLAG = -race
endif

release:
GO111MODULE=on go build -ldflags '$(LDFLAGS)' -o bin/br
all: check test build

build:
GO111MODULE=on go build -ldflags '$(LDFLAGS)' -race -o bin/br
GO111MODULE=on go build -ldflags '$(LDFLAGS)' ${RACEFLAG} -o bin/br

build_for_integration_test:
GO111MODULE=on go test -c -cover -covermode=count \
-coverpkg=$(BR_PKG)/... \
-o bin/br.test
# build key locker
GO111MODULE=on go build -race -o bin/locker tests/br_key_locked/*.go
GO111MODULE=on go build ${RACEFLAG} -o bin/locker tests/br_key_locked/*.go
# build gc
GO111MODULE=on go build -race -o bin/gc tests/br_z_gc_safepoint/*.go
GO111MODULE=on go build ${RACEFLAG} -o bin/gc tests/br_z_gc_safepoint/*.go
# build rawkv client
GO111MODULE=on go build ${RACEFLAG} -o bin/rawkv tests/br_rawkv/*.go

test:
GO111MODULE=on go test -race -tags leak ./...
GO111MODULE=on go test ${RACEFLAG} -tags leak ./...

testcover:
GO111MODULE=on retool do overalls \
Expand All @@ -46,6 +49,7 @@ integration_test: build build_for_integration_test
@which bin/pd-server
@which bin/pd-ctl
@which bin/go-ycsb
@which bin/minio
@which bin/br
tests/run.sh

Expand All @@ -71,6 +75,12 @@ static:
--disable interfacer \
--disable goimports \
--disable gofmt \
--disable wsl \
--disable funlen \
--disable whitespace \
--disable gocognit \
--disable godox \
--disable gomnd \
$$($(PACKAGE_DIRECTORIES))

lint:
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ Notice BR supports building with Go version `Go >= 1.13`

When BR is built successfully, you can find binary in the `bin` directory.

## Quick start

```sh
# Start TiDB cluster
docker-compose -f docker-compose.yaml rm -s -v && \
docker-compose -f docker-compose.yaml build && \
docker-compose -f docker-compose.yaml up --remove-orphans

# Attach to control container to run BR
docker exec -it br_control_1 bash

# Load testing data to TiDB
go-ycsb load mysql -p workload=core \
-p mysql.host=tidb -p mysql.port=4000 -p mysql.user=root \
-p recordcount=100000 -p threadcount=100

# How many rows do we get? 100000 rows.
mysql -uroot -htidb -P4000 -E -e "SELECT COUNT(*) FROM test.usertable"

# Build BR and backup!
make release && \
bin/br backup full --pd pd0:2379 --storage "local:///data/backup/full" \
--log-file "/logs/br_backup.log"

# Let's drop database.
mysql -uroot -htidb -P4000 -E -e "DROP DATABASE test; SHOW DATABASES;"

# Restore!
bin/br restore full --pd pd0:2379 --storage "local:///data/backup/full" \
--log-file "/logs/br_restore.log"

# How many rows do we get again? Expected to be 100000 rows.
mysql -uroot -htidb -P4000 -E -e "SELECT COUNT(*) FROM test.usertable"
```

## Contributing

Contributions are welcomed and greatly appreciated. See [CONTRIBUTING](./CONTRIBUTING.md)
Expand Down
Loading