Skip to content

Commit 88e59dd

Browse files
Merge branch 'master' into master
2 parents 57955b9 + 447a98a commit 88e59dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1198
-779
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v2
1212

13-
- name: Set up Go 1.12
13+
- name: Set up Go 1.14
1414
uses: actions/setup-go@v1
1515
with:
16-
version: 1.12
17-
id: go
16+
go-version: 1.14
1817

1918
- name: Build
2019
run: script/cibuild
20+
21+
- name: Upload gh-ost binary artifact
22+
uses: actions/upload-artifact@v1
23+
with:
24+
name: gh-ost
25+
path: bin/gh-ost

.github/workflows/replica-tests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v2
1212

13-
- name: Set up Go 1.12
13+
- name: Set up Go 1.14
1414
uses: actions/setup-go@v1
1515
with:
16-
version: 1.12
17-
id: go
16+
go-version: 1.14
1817

1918
- name: migration tests
2019
run: script/cibuild-gh-ost-replica-tests

Dockerfile.packaging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22

3-
FROM golang:1.12.6
3+
FROM golang:1.14.7
44

55
RUN apt-get update
66
RUN apt-get install -y ruby ruby-dev rubygems build-essential

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.12.1
1+
FROM golang:1.14.7
22
LABEL maintainer="[email protected]"
33

44
RUN apt-get update

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d
9595

9696
[Download latest release here](https://github.com/github/gh-ost/releases/latest)
9797

98-
`gh-ost` is a Go project; it is built with Go `1.12` and above. To build on your own, use either:
98+
`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either:
9999
- [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary.
100100
- [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost`
101101

@@ -110,3 +110,4 @@ Generally speaking, `master` branch is stable, but only [releases](https://githu
110110
- [@shlomi-noach](https://github.com/shlomi-noach)
111111
- [@jessbreckenridge](https://github.com/jessbreckenridge)
112112
- [@gtowey](https://github.com/gtowey)
113+
- [@timvaillancourt](https://github.com/timvaillancourt)

RELEASE_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.49
1+
1.1.0

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function build {
1818
GOOS=$3
1919
GOARCH=$4
2020

21-
if ! go version | egrep -q 'go(1\.1[234])' ; then
22-
echo "go version must be 1.12 or above"
21+
if ! go version | egrep -q 'go(1\.1[456])' ; then
22+
echo "go version must be 1.14 or above"
2323
exit 1
2424
fi
2525

doc/requirements-and-limitations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ The `SUPER` privilege is required for `STOP SLAVE`, `START SLAVE` operations. Th
5151

5252
- Migrating a `FEDERATED` table is unsupported and is irrelevant to the problem `gh-ost` tackles.
5353

54+
- [Encrypted binary logs](https://www.percona.com/blog/2018/03/08/binlog-encryption-percona-server-mysql/) are not supported.
5455
- `ALTER TABLE ... RENAME TO some_other_name` is not supported (and you shouldn't use `gh-ost` for such a trivial operation).

go/base/context.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919

2020
"github.com/github/gh-ost/go/mysql"
2121
"github.com/github/gh-ost/go/sql"
22+
"github.com/outbrain/golib/log"
2223

2324
"gopkg.in/gcfg.v1"
2425
gcfgscanner "gopkg.in/gcfg.v1/scanner"
@@ -76,9 +77,10 @@ func NewThrottleCheckResult(throttle bool, reason string, reasonHint ThrottleRea
7677
type MigrationContext struct {
7778
Uuid string
7879

79-
DatabaseName string
80-
OriginalTableName string
81-
AlterStatement string
80+
DatabaseName string
81+
OriginalTableName string
82+
AlterStatement string
83+
AlterStatementOptions string // anything following the 'ALTER TABLE [schema.]table' from AlterStatement
8284

8385
CountTableRows bool
8486
ConcurrentCountTableRows bool
@@ -218,6 +220,25 @@ type MigrationContext struct {
218220
ForceTmpTableName string
219221

220222
recentBinlogCoordinates mysql.BinlogCoordinates
223+
224+
Log Logger
225+
}
226+
227+
type Logger interface {
228+
Debug(args ...interface{})
229+
Debugf(format string, args ...interface{})
230+
Info(args ...interface{})
231+
Infof(format string, args ...interface{})
232+
Warning(args ...interface{}) error
233+
Warningf(format string, args ...interface{}) error
234+
Error(args ...interface{}) error
235+
Errorf(format string, args ...interface{}) error
236+
Errore(err error) error
237+
Fatal(args ...interface{}) error
238+
Fatalf(format string, args ...interface{}) error
239+
Fatale(err error) error
240+
SetLevel(level log.LogLevel)
241+
SetPrintStackTrace(printStackTraceFlag bool)
221242
}
222243

223244
type ContextConfig struct {
@@ -252,6 +273,7 @@ func NewMigrationContext() *MigrationContext {
252273
pointOfInterestTimeMutex: &sync.Mutex{},
253274
ColumnRenameMap: make(map[string]string),
254275
PanicAbort: make(chan error),
276+
Log: NewDefaultLogger(),
255277
}
256278
}
257279

go/base/default_logger.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package base
2+
3+
import (
4+
"github.com/outbrain/golib/log"
5+
)
6+
7+
type simpleLogger struct{}
8+
9+
func NewDefaultLogger() *simpleLogger {
10+
return &simpleLogger{}
11+
}
12+
13+
func (*simpleLogger) Debug(args ...interface{}) {
14+
log.Debug(args[0].(string), args[1:])
15+
return
16+
}
17+
18+
func (*simpleLogger) Debugf(format string, args ...interface{}) {
19+
log.Debugf(format, args...)
20+
return
21+
}
22+
23+
func (*simpleLogger) Info(args ...interface{}) {
24+
log.Info(args[0].(string), args[1:])
25+
return
26+
}
27+
28+
func (*simpleLogger) Infof(format string, args ...interface{}) {
29+
log.Infof(format, args...)
30+
return
31+
}
32+
33+
func (*simpleLogger) Warning(args ...interface{}) error {
34+
return log.Warning(args[0].(string), args[1:])
35+
}
36+
37+
func (*simpleLogger) Warningf(format string, args ...interface{}) error {
38+
return log.Warningf(format, args...)
39+
}
40+
41+
func (*simpleLogger) Error(args ...interface{}) error {
42+
return log.Error(args[0].(string), args[1:])
43+
}
44+
45+
func (*simpleLogger) Errorf(format string, args ...interface{}) error {
46+
return log.Errorf(format, args...)
47+
}
48+
49+
func (*simpleLogger) Errore(err error) error {
50+
return log.Errore(err)
51+
}
52+
53+
func (*simpleLogger) Fatal(args ...interface{}) error {
54+
return log.Fatal(args[0].(string), args[1:])
55+
}
56+
57+
func (*simpleLogger) Fatalf(format string, args ...interface{}) error {
58+
return log.Fatalf(format, args...)
59+
}
60+
61+
func (*simpleLogger) Fatale(err error) error {
62+
return log.Fatale(err)
63+
}
64+
65+
func (*simpleLogger) SetLevel(level log.LogLevel) {
66+
log.SetLevel(level)
67+
return
68+
}
69+
70+
func (*simpleLogger) SetPrintStackTrace(printStackTraceFlag bool) {
71+
log.SetPrintStackTrace(printStackTraceFlag)
72+
return
73+
}

0 commit comments

Comments
 (0)