Skip to content

Commit 8c4cd10

Browse files
Merge branch 'master' into ipv6
2 parents 809908c + 447a98a commit 8c4cd10

File tree

132 files changed

+19133
-2320
lines changed

Some content is hidden

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

132 files changed

+19133
-2320
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Go 1.14
14+
uses: actions/setup-go@v1
15+
with:
16+
go-version: 1.14
17+
18+
- name: Build
19+
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: migration tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Go 1.14
14+
uses: actions/setup-go@v1
15+
with:
16+
go-version: 1.14
17+
18+
- name: migration tests
19+
run: script/cibuild-gh-ost-replica-tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/bin/
33
/libexec/
44
/.vendor/
5+
.idea/

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

Dockerfile.packaging

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
3+
FROM golang:1.14.7
4+
5+
RUN apt-get update
6+
RUN apt-get install -y ruby ruby-dev rubygems build-essential
7+
RUN gem install --no-ri --no-rdoc fpm
8+
ENV GOPATH=/tmp/go
9+
10+
RUN apt-get install -y curl
11+
RUN apt-get install -y rsync
12+
RUN apt-get install -y gcc
13+
RUN apt-get install -y g++
14+
RUN apt-get install -y bash
15+
RUN apt-get install -y git
16+
RUN apt-get install -y tar
17+
RUN apt-get install -y rpm
18+
19+
RUN mkdir -p $GOPATH/src/github.com/github/gh-ost
20+
WORKDIR $GOPATH/src/github.com/github/gh-ost
21+
COPY . .
22+
RUN bash build.sh

Dockerfile.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:1.14.7
2+
LABEL maintainer="[email protected]"
3+
4+
RUN apt-get update
5+
RUN apt-get install -y lsb-release
6+
RUN rm -rf /var/lib/apt/lists/*
7+
8+
COPY . /go/src/github.com/github/gh-ost
9+
WORKDIR /go/src/github.com/github/gh-ost
10+
11+
CMD ["script/test"]

README.md

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

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

97-
`gh-ost` is a Go project; it is built with Go `1.9` and above. To build on your own, use either:
97+
`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either:
9898
- [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.
9999
- [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost`
100100

@@ -109,3 +109,4 @@ Generally speaking, `master` branch is stable, but only [releases](https://githu
109109
- [@shlomi-noach](https://github.com/shlomi-noach)
110110
- [@jessbreckenridge](https://github.com/jessbreckenridge)
111111
- [@gtowey](https://github.com/gtowey)
112+
- [@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.47
1+
1.1.0

build.sh

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

21-
22-
23-
if ! go version | egrep -q 'go(1[.]9|1[.]1[0-9])' ; then
24-
echo "go version is too low. Must use 1.9 or above"
21+
if ! go version | egrep -q 'go(1\.1[456])' ; then
22+
echo "go version must be 1.14 or above"
2523
exit 1
2624
fi
2725

@@ -42,8 +40,8 @@ function build {
4240
builddir=$(setuptree)
4341
cp $buildpath/$target $builddir/gh-ost/usr/bin
4442
cd $buildpath
45-
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m shlomi-noach --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t rpm .
46-
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m shlomi-noach --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t deb --deb-no-default-config-files .
43+
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'shlomi-noach <[email protected]>' --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t rpm .
44+
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'shlomi-noach <[email protected]>' --description "GitHub's Online Schema Migrations for MySQL " --url "https://github.com/github/gh-ost" --vendor "GitHub" --license "Apache 2.0" -C $builddir/gh-ost --prefix=/ -t deb --deb-no-default-config-files .
4745
fi
4846
}
4947

@@ -63,11 +61,11 @@ main() {
6361

6462
mkdir -p ${buildpath}
6563
rm -rf ${buildpath:?}/*
66-
build macOS osx darwin amd64
6764
build GNU/Linux linux linux amd64
65+
# build macOS osx darwin amd64
6866

6967
echo "Binaries found in:"
70-
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz
68+
find $buildpath/gh-ost* -type f -maxdepth 1
7169
}
7270

7371
main "$@"

doc/command-line-flags.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If, for some reason, you do not wish `gh-ost` to connect to a replica, you may c
1818

1919
### approve-renamed-columns
2020

21-
When your migration issues a column rename (`change column old_name new_name ...`) `gh-ost` analyzes the statement to try an associate the old column name with new column name. Otherwise the new structure may also look like some column was dropped and another was added.
21+
When your migration issues a column rename (`change column old_name new_name ...`) `gh-ost` analyzes the statement to try and associate the old column name with new column name. Otherwise the new structure may also look like some column was dropped and another was added.
2222

2323
`gh-ost` will print out what it thinks the _rename_ implied, but will not issue the migration unless you provide with `--approve-renamed-columns`.
2424

@@ -111,6 +111,14 @@ While the ongoing estimated number of rows is still heuristic, it's almost exact
111111

112112
Without this parameter, migration is a _noop_: testing table creation and validity of migration, but not touching data.
113113

114+
### force-named-cut-over
115+
116+
If given, a `cut-over` command must name the migrated table, or else ignored.
117+
118+
### force-named-panic
119+
120+
If given, a `panic` command must name the migrated table, or else ignored.
121+
114122
### force-table-names
115123

116124
Table name prefix to be used on the temporary tables.
@@ -153,7 +161,7 @@ List of metrics and threshold values; topping the threshold of any will cause th
153161

154162
### migrate-on-replica
155163

156-
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but other issue no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
164+
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but otherwise will make no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
157165

158166
### postpone-cut-over-flag-file
159167

@@ -173,10 +181,34 @@ See also: [`concurrent-migrations`](cheatsheet.md#concurrent-migrations) on the
173181

174182
By default `gh-ost` verifies no foreign keys exist on the migrated table. On servers with large number of tables this check can take a long time. If you're absolutely certain no foreign keys exist (table does not reference other table nor is referenced by other tables) and wish to save the check time, provide with `--skip-foreign-key-checks`.
175183

184+
### skip-strict-mode
185+
186+
By default `gh-ost` enforces STRICT_ALL_TABLES sql_mode as a safety measure. In some cases this changes the behaviour of other modes (namely ERROR_FOR_DIVISION_BY_ZERO, NO_ZERO_DATE, and NO_ZERO_IN_DATE) which may lead to errors during migration. Use `--skip-strict-mode` to explicitly tell `gh-ost` not to enforce this. **Danger** This may have some unexpected disastrous side effects.
187+
176188
### skip-renamed-columns
177189

178190
See [`approve-renamed-columns`](#approve-renamed-columns)
179191

192+
### ssl
193+
194+
By default `gh-ost` does not use ssl/tls connections to the database servers when performing migrations. This flag instructs `gh-ost` to use encrypted connections. If enabled, `gh-ost` will use the system's ca certificate pool for server certificate verification. If a different certificate is needed for server verification, see `--ssl-ca`. If you wish to skip server verification, but still use encrypted connections, use with `--ssl-allow-insecure`.
195+
196+
### ssl-allow-insecure
197+
198+
Allows `gh-ost` to connect to the MySQL servers using encrypted connections, but without verifying the validity of the certificate provided by the server during the connection. Requires `--ssl`.
199+
200+
### ssl-ca
201+
202+
`--ssl-ca=/path/to/ca-cert.pem`: ca certificate file (in PEM format) to use for server certificate verification. If specified, the default system ca cert pool will not be used for verification, only the ca cert provided here. Requires `--ssl`.
203+
204+
### ssl-cert
205+
206+
`--ssl-cert=/path/to/ssl-cert.crt`: SSL public key certificate file (in PEM format).
207+
208+
### ssl-key
209+
210+
`--ssl-key=/path/to/ssl-key.key`: SSL private key file (in PEM format).
211+
180212
### test-on-replica
181213

182214
Issue the migration on a replica; do not modify data on master. Useful for validating, testing and benchmarking. See [`testing-on-replica`](testing-on-replica.md)

0 commit comments

Comments
 (0)