Skip to content

Commit

Permalink
*: use default 1s for schema lease.
Browse files Browse the repository at this point in the history
  • Loading branch information
siddontang committed Nov 30, 2015
1 parent 151e8b1 commit 638d330
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion interpreter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
logLevel = flag.String("L", "error", "log level")
store = flag.String("store", "goleveldb", "the name for the registered storage, e.g. memory, goleveldb, boltdb")
dbPath = flag.String("dbpath", "test/test", "db path")
lease = flag.Int("lease", 300, "schema lease seconds, very dangerous to change only if you know what you do")
lease = flag.Int("lease", 1, "schema lease seconds, very dangerous to change only if you know what you do")

line *liner.State
historyPath = "/tmp/tidb_interpreter"
Expand Down
2 changes: 1 addition & 1 deletion tidb-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
storePath = flag.String("path", "/tmp/tidb", "tidb storage path")
logLevel = flag.String("L", "debug", "log level: info, debug, warn, error, fatal")
port = flag.String("P", "4000", "mp server port")
lease = flag.Int("lease", 300, "schema lease seconds, very dangerous to change only if you know what you do")
lease = flag.Int("lease", 1, "schema lease seconds, very dangerous to change only if you know what you do")
)

func main() {
Expand Down
7 changes: 4 additions & 3 deletions tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ var (
// store.UUID()-> IfBootstrapped
storeBootstrapped = make(map[string]bool)

// SchemaLease is the time(seconds) for re-updating remote schema.
// schemaLease is the time for re-updating remote schema.
// In online DDL, we must wait 2 * SchemaLease time to guarantee
// all servers get the neweset schema.
// Default schema lease time is 300 seconds, you can change it with a proper time,
// Default schema lease time is 1 second, you can change it with a proper time,
// but you must know that too little may cause badly performance degradation.
schemaLease = 300 * time.Second
// For production, you should set a big schema lease, like 300s+.
schemaLease = 1 * time.Second
)

// SetSchemaLease changes the default schema lease time for DDL.
Expand Down

0 comments on commit 638d330

Please sign in to comment.