Skip to content

Commit 574c372

Browse files
author
Shlomi Noach
authored
Merge pull request #64 from github/safe-cut-over
Safe cut over
2 parents 302dbf0 + 85d6883 commit 574c372

File tree

5 files changed

+266
-181
lines changed

5 files changed

+266
-181
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
#
4-
RELEASE_VERSION="0.8.9"
4+
RELEASE_VERSION="0.9.1"
55

66
buildpath=/tmp/gh-ost
77
target=gh-ost

go/base/context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ const (
3131
type CutOver int
3232

3333
const (
34-
CutOverTwoStep CutOver = iota
35-
CutOverVoluntaryLock = iota
36-
CutOverUdfWait = iota
34+
CutOverSafe CutOver = iota
35+
CutOverTwoStep = iota
3736
)
3837

3938
const (
@@ -100,6 +99,7 @@ type MigrationContext struct {
10099
isThrottled bool
101100
throttleReason string
102101
throttleMutex *sync.Mutex
102+
IsPostponingCutOver int64
103103

104104
OriginalTableColumns *sql.ColumnList
105105
OriginalTableUniqueKeys [](*sql.UniqueKey)

go/cmd/gh-ost/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,10 @@ func main() {
128128
log.Fatalf("--allow-on-master and --test-on-replica are mutually exclusive")
129129
}
130130
switch *cutOver {
131+
case "safe", "default", "":
132+
migrationContext.CutOverType = base.CutOverSafe
131133
case "two-step":
132134
migrationContext.CutOverType = base.CutOverTwoStep
133-
case "voluntary-lock":
134-
migrationContext.CutOverType = base.CutOverVoluntaryLock
135-
case "":
136-
log.Fatalf("--cut-over must be specified")
137135
default:
138136
log.Fatalf("Unknown cut-over: %s", *cutOver)
139137
}

0 commit comments

Comments
 (0)