Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
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
10 changes: 5 additions & 5 deletions go.mod1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/aws/aws-sdk-go v1.35.3
github.com/carlmjohnson/flagext v0.20.2
github.com/carlmjohnson/flagext v0.21.0
github.com/cheggaaa/pb/v3 v3.0.5
github.com/cheynewallace/tabby v1.1.0
github.com/cockroachdb/pebble v0.0.0-20201023120638-f1224da22976
Expand All @@ -19,15 +19,15 @@ require (
github.com/golang/mock v1.4.4
github.com/google/btree v1.0.0
github.com/google/uuid v1.1.1
github.com/joho/sqltocsv v0.0.0-20190824231449-5650f27fd5b6
github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99
github.com/opentracing/opentracing-go v1.1.0
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
github.com/pingcap/errors v0.11.5-0.20201126102027-b0a155152ca3
github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce
github.com/pingcap/kvproto v0.0.0-20210308063835-39b884695fb8
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8
github.com/pingcap/parser v0.0.0-20210310110710-c7333a4927e6
github.com/pingcap/tidb v1.1.0-beta.0.20210316111949-26ccbe972ac5
github.com/pingcap/parser v0.0.0-20210311132237-9841cb715606
github.com/pingcap/tidb v1.1.0-beta.0.20210318132835-915dde1f93df
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible
github.com/pingcap/tipb v0.0.0-20210309080453-72c4feaa6da7
github.com/prometheus/client_golang v1.5.1
Expand All @@ -50,7 +50,7 @@ require (
golang.org/x/text v0.3.5
google.golang.org/api v0.22.0
google.golang.org/grpc v1.27.1
modernc.org/mathutil v1.1.1
modernc.org/mathutil v1.2.2
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0
)

Expand Down
22 changes: 11 additions & 11 deletions go.sum1
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d h1:rQ
github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d/go.mod h1:VKt7CNAQxpFpSDz3sXyj9hY/GbVsQCr0sB3w59nE7lU=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 h1:BjkPE3785EwPhhyuFkbINB+2a1xATwk8SNDWnJiD41g=
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5/go.mod h1:jtAfVaU/2cu1+wdSRPWE2c1N2qeAA3K4RH9pYgqwets=
github.com/carlmjohnson/flagext v0.20.2 h1:qvpMM+TytSrlh3+EIVn/pzOwwq9y13hXZab6Y4Gvqpo=
github.com/carlmjohnson/flagext v0.20.2/go.mod h1:Eenv0epIUAr4NuedNmkzI8WmBmjIxZC239XcKxYS2ac=
github.com/carlmjohnson/flagext v0.21.0 h1:/c4uK3ie786Z7caXLcIMvePNSSiH3bQVGDvmGLMme60=
github.com/carlmjohnson/flagext v0.21.0/go.mod h1:Eenv0epIUAr4NuedNmkzI8WmBmjIxZC239XcKxYS2ac=
github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 h1:JLaf/iINcLyjwbtTsCJjc6rtlASgHeIJPrB6QmwURnA=
Expand Down Expand Up @@ -318,8 +318,8 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/joho/sqltocsv v0.0.0-20190824231449-5650f27fd5b6 h1:3Jr6Mtili6DsXSF0RwRlAqpOUWXcSVUxdOm5kFPb3xY=
github.com/joho/sqltocsv v0.0.0-20190824231449-5650f27fd5b6/go.mod h1:mAVCUAYtW9NG31eB30umMSLKcDt6mCUWSjoSn5qBh0k=
github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99 h1:yYV8KMzsc4ius4P8A9BK13cY6nFDL3jlVX25HvEXOkw=
github.com/joho/sqltocsv v0.0.0-20210208114054-cb2c3a95fb99/go.mod h1:mAVCUAYtW9NG31eB30umMSLKcDt6mCUWSjoSn5qBh0k=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/joomcode/errorx v1.0.1/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ=
Expand Down Expand Up @@ -432,7 +432,7 @@ github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUM
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19 h1:IXpGy7y9HyoShAFmzW2OPF0xCA5EOoSTyZHwsgYk9Ro=
github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19/go.mod h1:LyrqUOHZrUDf9oGi1yoz1+qw9ckSIhQb5eMa1acOLNQ=
github.com/pingcap/br v4.0.0-beta.2.0.20210302095941-59e4efeaeb47+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ=
github.com/pingcap/br v5.0.0-nightly.0.20210317100924-d95f9fdfcd29+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ=
github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ=
github.com/pingcap/check v0.0.0-20191107115940-caf2b9e6ccf4/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc=
github.com/pingcap/check v0.0.0-20191216031241-8a5a85928f12/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc=
Expand Down Expand Up @@ -463,13 +463,13 @@ github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIf
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8 h1:M+DNpOu/I3uDmwee6vcnoPd6GgSMqND4gxvDQ/W584U=
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/parser v0.0.0-20210310110710-c7333a4927e6 h1:V/6ioJmVUN4q6/aUpNdnT6OOPc48R3tnojcVfTrt4QU=
github.com/pingcap/parser v0.0.0-20210310110710-c7333a4927e6/go.mod h1:GbEr2PgY72/4XqPZzmzstlOU/+il/wrjeTNFs6ihsSE=
github.com/pingcap/parser v0.0.0-20210311132237-9841cb715606 h1:/d3CdGzpfCRbdKn38gYH4FGEXgTJCzfI8yroEfKcwbA=
github.com/pingcap/parser v0.0.0-20210311132237-9841cb715606/go.mod h1:GbEr2PgY72/4XqPZzmzstlOU/+il/wrjeTNFs6ihsSE=
github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
github.com/pingcap/sysutil v0.0.0-20210221112134-a07bda3bde99 h1:/ogXgm4guJzow4UafiyXZ6ciAIPzxImaXYiFvTpKzKY=
github.com/pingcap/sysutil v0.0.0-20210221112134-a07bda3bde99/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
github.com/pingcap/tidb v1.1.0-beta.0.20210316111949-26ccbe972ac5 h1:GVYHbzxNrM59/PFytA0tJv8sRH1GHD4dwXa8cO5bWBE=
github.com/pingcap/tidb v1.1.0-beta.0.20210316111949-26ccbe972ac5/go.mod h1:Fn9Sdoi9V1SJvX9sfaObSbLy7eFyvTCPzDo+590fy4o=
github.com/pingcap/tidb v1.1.0-beta.0.20210318132835-915dde1f93df h1:rSg2ogob9Gg9B1NNcjlZ5+PHy+L8jZMk2Yjl5LDVqSA=
github.com/pingcap/tidb v1.1.0-beta.0.20210318132835-915dde1f93df/go.mod h1:1itH8MaUbgR9MgwT/jAjO4xeCncOc7GQju1MqaXzEi4=
github.com/pingcap/tidb-dashboard v0.0.0-20210312062513-eef5d6404638/go.mod h1:OzFN8H0EDMMqeulPhPMw2i2JaiZWOKFQ7zdRPhENNgo=
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible h1:ceznmu/lLseGHP/jKyOa/3u/5H3wtLLLqkH2V3ssSjg=
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
Expand Down Expand Up @@ -945,8 +945,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE=
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY=
modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
4 changes: 0 additions & 4 deletions pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,6 @@ func enableTiDBConfig() func() {
// when upstream and downstream both set this value greater than default(3072)
conf.MaxIndexLength = config.DefMaxOfMaxIndexLength
log.Warn("set max-index-length to max(3072*4) to skip check index length in DDL")

// we need set this to true, since all create table DDLs will create with tableInfo
// and we can handle alter drop pk/add pk DDLs with no impact
conf.AlterPrimaryKey = true
})
return restoreConfig
}
Expand Down
5 changes: 0 additions & 5 deletions tests/br_db/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
set -eu
DB="$TEST_NAME"

old_conf=$(run_sql "show config where name = 'alter-primary-key'" | awk '/Value/{print $2}')
run_sql "CREATE DATABASE $DB;"

run_sql "CREATE TABLE $DB.usertable1 ( \
Expand Down Expand Up @@ -56,8 +55,4 @@ echo "testing DDL query..."
run_curl https://$TIDB_STATUS_ADDR/ddl/history | grep -E '/\*from\(br\)\*/CREATE TABLE'
run_curl https://$TIDB_STATUS_ADDR/ddl/history | grep -E '/\*from\(br\)\*/CREATE DATABASE'

# test whether we have changed the cluster config.
new_conf=$(run_sql "show config where name = 'alter-primary-key'" | awk '/Value/{print $2}')
test "$old_conf" = "$new_conf"

run_sql "DROP DATABASE $DB;"
4 changes: 0 additions & 4 deletions tests/br_full/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ set -eu
DB="$TEST_NAME"
TABLE="usertable"
DB_COUNT=3
old_conf=$(run_sql "show config where name = 'alter-primary-key'")

for i in $(seq $DB_COUNT); do
run_sql "CREATE DATABASE $DB${i};"
Expand Down Expand Up @@ -89,9 +88,6 @@ for ct in limit lz4 zstd; do
fi
done

# test whether we have changed the cluster config.
test "$old_conf" = "$(run_sql "show config where name = 'alter-primary-key'")"

for i in $(seq $DB_COUNT); do
run_sql "DROP DATABASE $DB${i};"
done

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

# Schema lease duration
# There are lot of ddl in the tests, setting this
# to 360s to test whther BR is gracefully shutdown.
# to 360s to test whether BR is gracefully shutdown.
lease = "360s"

alter-primary-key = true
max-index-length = 12288

[security]
Expand Down
15 changes: 4 additions & 11 deletions tests/br_incompatible_tidb_config/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ source $cur/../_utils/run_services
DB="$TEST_NAME"

# prepare database
echo "Restart cluster with alter-primary-key = true, max-index-length=12288"
start_services --tidb-cfg $cur/config/tidb-alter-primary-key.toml
echo "Restart cluster with max-index-length=12288"
start_services --tidb-cfg $cur/config/tidb-max-index-length.toml

run_sql "drop schema if exists $DB;"
run_sql "create schema $DB;"
Expand All @@ -31,13 +31,13 @@ run_sql "create schema $DB;"
TABLE="t1"
INCREMENTAL_TABLE="t1inc"

run_sql "create table $DB.$TABLE (a int primary key, b int unique);"
run_sql "create table $DB.$TABLE (a int primary key nonclustered, b int unique);"
run_sql "insert into $DB.$TABLE values (42, 42);"

# backup
run_br --pd $PD_ADDR backup db --db "$DB" -s "local://$TEST_DIR/$DB$TABLE"

run_sql "create table $DB.$INCREMENTAL_TABLE (a int primary key, b int unique);"
run_sql "create table $DB.$INCREMENTAL_TABLE (a int primary key nonclustered, b int unique);"
run_sql "insert into $DB.$INCREMENTAL_TABLE values (42, 42);"

# drop pk
Expand Down Expand Up @@ -73,13 +73,6 @@ run_br --pd $PD_ADDR restore db --db "$DB" -s "local://$TEST_DIR/$DB$TABLE"

run_sql "drop schema $DB;"

# we need set auto_random to true and remove alter-primary-key otherwise we will get error
# invalid config allow-auto-random is unavailable when alter-primary-key is enabled

# enable column attribute `auto_random` to be defined on the primary key column.
echo "Restart cluster with allow-auto-random=true"
start_services --tidb-cfg $cur/config/tidb-allow-auto-random.toml

# test auto random issue https://github.com/pingcap/br/issues/228
TABLE="t3"
INCREMENTAL_TABLE="t3inc"
Expand Down