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

Commit 7de169d

Browse files
kennytm3pointer
andauthored
glue: create schema/table directly with info (#216)
* glue: create schema/table directly with info * go.mod: change to use the master version * gluetidb: fix failure to create schema * gluetidb: exclude non-public indices when restoring * go.mod: removed unused replace Co-authored-by: 3pointer <luancheng@pingcap.com>
1 parent 3341f40 commit 7de169d

File tree

11 files changed

+123
-111
lines changed

11 files changed

+123
-111
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ require (
2121
github.com/onsi/gomega v1.8.1 // indirect
2222
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
2323
github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011
24-
github.com/pingcap/kvproto v0.0.0-20200317112120-78042b285b75
24+
github.com/pingcap/kvproto v0.0.0-20200330093347-98f910b71904
2525
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd
26-
github.com/pingcap/parser v0.0.0-20200317021010-cd90cc2a7d87
26+
github.com/pingcap/parser v0.0.0-20200326020624-68d423641be5
2727
github.com/pingcap/pd/v4 v4.0.0-beta.1.0.20200305072537-61d9f9cc35d3
28-
github.com/pingcap/tidb v1.1.0-beta.0.20200325094938-30e1edae0897
28+
github.com/pingcap/tidb v0.0.0-20200401141416-959eca8f3a39
2929
github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306084441-875bd09aa3d5+incompatible
3030
github.com/pingcap/tipb v0.0.0-20200212061130-c4d518eb1d60
3131
github.com/prometheus/client_golang v1.0.0
@@ -37,7 +37,7 @@ require (
3737
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
3838
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
3939
go.opencensus.io v0.22.2 // indirect
40-
go.uber.org/zap v1.14.0
40+
go.uber.org/zap v1.14.1
4141
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
4242
google.golang.org/api v0.14.0
4343
google.golang.org/grpc v1.25.1

go.sum

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -363,24 +363,23 @@ github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17Xtb
363363
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
364364
github.com/pingcap/kvproto v0.0.0-20200214064158-62d31900d88e/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
365365
github.com/pingcap/kvproto v0.0.0-20200221034943-a2aa1d1e20a8/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
366-
github.com/pingcap/kvproto v0.0.0-20200228095611-2cf9a243b8d5/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
367-
github.com/pingcap/kvproto v0.0.0-20200317112120-78042b285b75 h1:DB3NTM0ilba/6sW+vccdEnP10bVvrVunDwWvRa0hSKc=
368-
github.com/pingcap/kvproto v0.0.0-20200317112120-78042b285b75/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
366+
github.com/pingcap/kvproto v0.0.0-20200330093347-98f910b71904 h1:pMFUXvhJ62hX8m0Q4RsL7L+hSW1mAMG26So5eFMoAtI=
367+
github.com/pingcap/kvproto v0.0.0-20200330093347-98f910b71904/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
369368
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9 h1:AJD9pZYm72vMgPcQDww9rkZ1DnWfl0pXV3BOWlkYIjA=
370369
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
371370
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfEgRJ4T9NGgGTxdHpJerent7rM=
372371
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
373-
github.com/pingcap/parser v0.0.0-20200317021010-cd90cc2a7d87 h1:533jEUp3mtfWjk0el+awLbyGVxiHcUIGWcR1Y7gB+fg=
374-
github.com/pingcap/parser v0.0.0-20200317021010-cd90cc2a7d87/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4=
372+
github.com/pingcap/parser v0.0.0-20200326020624-68d423641be5 h1:fXVqoeYfV+xI8K2he5NNv00c6YksrjeM6+vkNo1ZK2Q=
373+
github.com/pingcap/parser v0.0.0-20200326020624-68d423641be5/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4=
375374
github.com/pingcap/pd/v4 v4.0.0-beta.1.0.20200305072537-61d9f9cc35d3 h1:Yrp99FnjHAEuDrSBql2l0IqCtJX7KwJbTsD5hIArkvk=
376375
github.com/pingcap/pd/v4 v4.0.0-beta.1.0.20200305072537-61d9f9cc35d3/go.mod h1:25GfNw6+Jcr9kca5rtmTb4gKCJ4jOpow2zV2S9Dgafs=
377376
github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
378377
github.com/pingcap/sysutil v0.0.0-20200302022240-21c8c70d0ab1 h1:YUnUZ914SHFMsOSe/xgH5DKK/thtRma8X8hcszRo3CA=
379378
github.com/pingcap/sysutil v0.0.0-20200302022240-21c8c70d0ab1/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
380379
github.com/pingcap/sysutil v0.0.0-20200309085538-962fd285f3bb h1:bDbgLaNTRNK6Qw7KjvEqqfCQstY8WMEcXyXTU7yzYKg=
381380
github.com/pingcap/sysutil v0.0.0-20200309085538-962fd285f3bb/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
382-
github.com/pingcap/tidb v1.1.0-beta.0.20200325094938-30e1edae0897 h1:wTNFJMM6GNmG09YoN3/3K8BqiK74zKkurjm4iY+m2mI=
383-
github.com/pingcap/tidb v1.1.0-beta.0.20200325094938-30e1edae0897/go.mod h1:4CGOiKZSaOU/Da3QYMtp0c3uBE2SxpcLOpESXmeQhcs=
381+
github.com/pingcap/tidb v0.0.0-20200401141416-959eca8f3a39 h1:nYRL69Qc4kuvp+tlDNB5wXjvDetX0J7g0DsW4RQxfXM=
382+
github.com/pingcap/tidb v0.0.0-20200401141416-959eca8f3a39/go.mod h1:btnHsqUQvJnY18+OP2Z6MCRq1tX4B8JUCrmqctSKxOg=
384383
github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306084441-875bd09aa3d5+incompatible h1:84F7MFMfdAYObrznvRslmVu43aoihrlL+7mMyMlOi0o=
385384
github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306084441-875bd09aa3d5+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
386385
github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI=
@@ -535,8 +534,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
535534
go.uber.org/zap v1.12.0 h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw=
536535
go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
537536
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
538-
go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o=
539-
go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
537+
go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo=
538+
go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
540539
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
541540
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
542541
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -676,8 +675,8 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn
676675
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
677676
golang.org/x/tools v0.0.0-20200301222351-066e0c02454c h1:FD7jysxM+EJqg5UYYy3XYDsAiUickFsn4UiaanJkf8c=
678677
golang.org/x/tools v0.0.0-20200301222351-066e0c02454c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
679-
golang.org/x/tools v0.0.0-20200313205530-4303120df7d8 h1:gkI/wGGwpcG5W4hLCzZNGxA4wzWBGGDStRI1MrjDl2Q=
680-
golang.org/x/tools v0.0.0-20200313205530-4303120df7d8/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
678+
golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1 h1:odiryKYJy7CjdrZxhrcE1Z8L9+kGyGZOnfpuauvdCeU=
679+
golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
681680
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
682681
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
683682
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

pkg/backup/client.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,16 @@ func BuildBackupRangeAndSchema(
224224
zap.Stringer("table", tableInfo.Name),
225225
zap.Int64("AutoIncID", globalAutoID))
226226

227+
// remove all non-public indices
228+
n := 0
229+
for _, index := range tableInfo.Indices {
230+
if index.State == model.StatePublic {
231+
tableInfo.Indices[n] = index
232+
n++
233+
}
234+
}
235+
tableInfo.Indices = tableInfo.Indices[:n]
236+
227237
if dbData == nil {
228238
dbData, err = json.Marshal(dbInfo)
229239
if err != nil {

pkg/glue/glue.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
pd "github.com/pingcap/pd/v4/client"
1010
"github.com/pingcap/tidb/domain"
1111
"github.com/pingcap/tidb/kv"
12-
"github.com/pingcap/tidb/meta/autoid"
1312
)
1413

1514
// Glue is an abstraction of TiDB function calls used in BR.
@@ -28,8 +27,8 @@ type Glue interface {
2827
// Session is an abstraction of the session.Session interface.
2928
type Session interface {
3029
Execute(ctx context.Context, sql string) error
31-
ShowCreateDatabase(schema *model.DBInfo) (string, error)
32-
ShowCreateTable(table *model.TableInfo, allocator autoid.Allocator) (string, error)
30+
CreateDatabase(ctx context.Context, schema *model.DBInfo) error
31+
CreateTable(ctx context.Context, dbName model.CIStr, table *model.TableInfo) error
3332
Close()
3433
}
3534

pkg/gluetidb/glue.go

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
package gluetidb
44

55
import (
6-
"bytes"
76
"context"
87

98
"github.com/pingcap/parser/model"
9+
"github.com/pingcap/parser/mysql"
1010
pd "github.com/pingcap/pd/v4/client"
11+
"github.com/pingcap/tidb/ddl"
1112
"github.com/pingcap/tidb/domain"
12-
"github.com/pingcap/tidb/executor"
1313
"github.com/pingcap/tidb/kv"
14-
"github.com/pingcap/tidb/meta/autoid"
1514
"github.com/pingcap/tidb/session"
1615

1716
"github.com/pingcap/br/pkg/glue"
@@ -62,22 +61,29 @@ func (gs *tidbSession) Execute(ctx context.Context, sql string) error {
6261
return err
6362
}
6463

65-
// ShowCreateDatabase implements glue.Session
66-
func (gs *tidbSession) ShowCreateDatabase(schema *model.DBInfo) (string, error) {
67-
var buf bytes.Buffer
68-
if err := executor.ConstructResultOfShowCreateDatabase(gs.se, schema, true, &buf); err != nil {
69-
return "", err
64+
// CreateDatabase implements glue.Session
65+
func (gs *tidbSession) CreateDatabase(ctx context.Context, schema *model.DBInfo) error {
66+
d := domain.GetDomain(gs.se).DDL()
67+
schema = schema.Clone()
68+
if len(schema.Charset) == 0 {
69+
schema.Charset = mysql.DefaultCharset
7070
}
71-
return buf.String(), nil
71+
return d.CreateSchemaWithInfo(gs.se, schema, ddl.OnExistIgnore, true)
7272
}
7373

74-
// ShowCreateTable implements glue.Session
75-
func (gs *tidbSession) ShowCreateTable(table *model.TableInfo, allocator autoid.Allocator) (string, error) {
76-
var buf bytes.Buffer
77-
if err := executor.ConstructResultOfShowCreateTable(gs.se, table, allocator, &buf); err != nil {
78-
return "", err
74+
// CreateTable implements glue.Session
75+
func (gs *tidbSession) CreateTable(ctx context.Context, dbName model.CIStr, table *model.TableInfo) error {
76+
d := domain.GetDomain(gs.se).DDL()
77+
78+
// Clone() does not clone partitions yet :(
79+
table = table.Clone()
80+
if table.Partition != nil {
81+
newPartition := *table.Partition
82+
newPartition.Definitions = append([]model.PartitionDefinition{}, table.Partition.Definitions...)
83+
table.Partition = &newPartition
7984
}
80-
return buf.String(), nil
85+
86+
return d.CreateTableWithInfo(gs.se, dbName, table, ddl.OnExistIgnore, true)
8187
}
8288

8389
// Close implements glue.Session

pkg/restore/db.go

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"context"
77
"fmt"
88
"sort"
9-
"strings"
109

1110
"github.com/pingcap/errors"
1211
"github.com/pingcap/log"
@@ -70,57 +69,28 @@ func (db *DB) ExecDDL(ctx context.Context, ddlJob *model.Job) error {
7069

7170
// CreateDatabase executes a CREATE DATABASE SQL.
7271
func (db *DB) CreateDatabase(ctx context.Context, schema *model.DBInfo) error {
73-
createSQL, err := db.se.ShowCreateDatabase(schema)
72+
err := db.se.CreateDatabase(ctx, schema)
7473
if err != nil {
75-
log.Error("build create database SQL failed", zap.Stringer("db", schema.Name), zap.Error(err))
76-
return errors.Trace(err)
77-
}
78-
err = db.se.Execute(ctx, createSQL)
79-
if err != nil {
80-
log.Error("create database failed", zap.String("query", createSQL), zap.Error(err))
74+
log.Error("create database failed", zap.Stringer("db", schema.Name), zap.Error(err))
8175
}
8276
return errors.Trace(err)
8377
}
8478

8579
// CreateTable executes a CREATE TABLE SQL.
8680
func (db *DB) CreateTable(ctx context.Context, table *utils.Table) error {
87-
tableInfo := table.Info
88-
createSQL, err := db.se.ShowCreateTable(tableInfo, newIDAllocator(tableInfo.AutoIncID))
89-
if err != nil {
90-
log.Error(
91-
"build create table SQL failed",
92-
zap.Stringer("db", table.Db.Name),
93-
zap.Stringer("table", tableInfo.Name),
94-
zap.Error(err))
95-
return errors.Trace(err)
96-
}
97-
switchDbSQL := fmt.Sprintf("use %s;", utils.EncloseName(table.Db.Name.O))
98-
err = db.se.Execute(ctx, switchDbSQL)
99-
if err != nil {
100-
log.Error("switch db failed",
101-
zap.String("SQL", switchDbSQL),
102-
zap.Stringer("db", table.Db.Name),
103-
zap.Error(err))
104-
return errors.Trace(err)
105-
}
106-
// Insert `IF NOT EXISTS` statement to skip the created tables
107-
words := strings.SplitN(createSQL, " ", 3)
108-
if len(words) > 2 && strings.ToUpper(words[0]) == "CREATE" && strings.ToUpper(words[1]) == "TABLE" {
109-
createSQL = "CREATE TABLE IF NOT EXISTS " + words[2]
110-
}
111-
err = db.se.Execute(ctx, createSQL)
81+
err := db.se.CreateTable(ctx, table.Db.Name, table.Info)
11282
if err != nil {
11383
log.Error("create table failed",
114-
zap.String("SQL", createSQL),
11584
zap.Stringer("db", table.Db.Name),
11685
zap.Stringer("table", table.Info.Name),
11786
zap.Error(err))
11887
return errors.Trace(err)
11988
}
12089
alterAutoIncIDSQL := fmt.Sprintf(
121-
"alter table %s auto_increment = %d",
122-
utils.EncloseName(tableInfo.Name.O),
123-
tableInfo.AutoIncID)
90+
"alter table %s.%s auto_increment = %d",
91+
utils.EncloseName(table.Db.Name.O),
92+
utils.EncloseName(table.Info.Name.O),
93+
table.Info.AutoIncID)
12494
err = db.se.Execute(ctx, alterAutoIncIDSQL)
12595
if err != nil {
12696
log.Error("alter AutoIncID failed",

pkg/restore/util.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/pingcap/kvproto/pkg/metapb"
1717
"github.com/pingcap/log"
1818
"github.com/pingcap/parser/model"
19-
"github.com/pingcap/tidb/meta/autoid"
2019
"github.com/pingcap/tidb/tablecodec"
2120
"github.com/pingcap/tidb/util/codec"
2221
"go.uber.org/zap"
@@ -28,44 +27,6 @@ import (
2827

2928
var recordPrefixSep = []byte("_r")
3029

31-
// idAllocator always returns a specified ID
32-
type idAllocator struct {
33-
id int64
34-
}
35-
36-
func newIDAllocator(id int64) *idAllocator {
37-
return &idAllocator{id: id}
38-
}
39-
40-
func (alloc *idAllocator) Alloc(tableID int64, n uint64, increment, offset int64) (min int64, max int64, err error) {
41-
return alloc.id, alloc.id, nil
42-
}
43-
44-
func (alloc *idAllocator) AllocSeqCache(sequenceID int64) (min int64, max int64, round int64, err error) {
45-
// TODO fix this function after support backup sequence
46-
return 0, 0, 0, nil
47-
}
48-
49-
func (alloc *idAllocator) Rebase(tableID, newBase int64, allocIDs bool) error {
50-
return nil
51-
}
52-
53-
func (alloc *idAllocator) Base() int64 {
54-
return alloc.id
55-
}
56-
57-
func (alloc *idAllocator) End() int64 {
58-
return alloc.id
59-
}
60-
61-
func (alloc *idAllocator) NextGlobalAutoID(tableID int64) (int64, error) {
62-
return alloc.id, nil
63-
}
64-
65-
func (alloc *idAllocator) GetType() autoid.AllocatorType {
66-
return autoid.RowIDAllocType
67-
}
68-
6930
// GetRewriteRules returns the rewrite rule of the new table and the old table.
7031
func GetRewriteRules(
7132
newTable *model.TableInfo,

tests/_utils/run_services

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ stop_services() {
3838
start_services() {
3939
stop_services
4040

41+
TIDB_CONFIG="${1-tests}/config/tidb.toml"
42+
TIKV_CONFIG="${1-tests}/config/tikv.toml"
43+
4144
echo "Starting PD..."
4245
mkdir -p "$TEST_DIR/pd"
4346
bin/pd-server \
@@ -63,7 +66,7 @@ start_services() {
6366
-A "$TIKV_ADDR$i" \
6467
--status-addr "$TIKV_STATUS_ADDR$i" \
6568
--log-file "$TEST_DIR/tikv${i}.log" \
66-
-C "tests/config/tikv.toml" \
69+
-C "$TIKV_CONFIG" \
6770
-s "$TEST_DIR/tikv${i}" &
6871
done
6972

@@ -83,7 +86,7 @@ start_services() {
8386
--status 10080 \
8487
--store tikv \
8588
--path "$PD_ADDR" \
86-
--config "tests/config/tidb.toml" \
89+
--config "$TIDB_CONFIG" \
8790
--log-file "$TEST_DIR/tidb.log" &
8891

8992
echo "Verifying TiDB is started..."
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# config of tidb
2+
3+
# Schema lease duration
4+
# There are lot of ddl in the tests, setting this
5+
# to 360s to test whther BR is gracefully shutdown.
6+
lease = "360s"
7+
8+
alter-primary-key = true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# config of tikv
2+
3+
[coprocessor]
4+
region-max-keys = 20
5+
region-split-keys = 12
6+
7+
[rocksdb]
8+
max-open-files = 4096
9+
[raftdb]
10+
max-open-files = 4096
11+
[raftstore]
12+
# true (default value) for high reliability, this can prevent data loss when power failure.
13+
sync-log = false
14+
capacity = "10GB"

0 commit comments

Comments
 (0)