Skip to content

Commit 7b3d688

Browse files
Merge branch 'master' into hidden-password-cmdline
2 parents f54078a + aef2a69 commit 7b3d688

50 files changed

Lines changed: 702 additions & 122 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212

13-
- name: Set up Go 1.14
13+
- name: Set up Go 1.16
1414
uses: actions/setup-go@v1
1515
with:
16-
go-version: 1.14
16+
go-version: 1.16
1717

1818
- name: Build
1919
run: script/cibuild

.github/workflows/replica-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ jobs:
66
build:
77

88
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
version: [mysql-5.5.62,mysql-5.6.43,mysql-5.7.25,mysql-8.0.16]
912

1013
steps:
1114
- uses: actions/checkout@v2
1215

13-
- name: Set up Go 1.14
16+
- name: Set up Go 1.16
1417
uses: actions/setup-go@v1
1518
with:
16-
go-version: 1.14
19+
go-version: 1.16
1720

1821
- name: migration tests
22+
env:
23+
TEST_MYSQL_VERSION: ${{ matrix.version }}
1924
run: script/cibuild-gh-ost-replica-tests

Dockerfile.packaging

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#
2-
3-
FROM golang:1.14.7
1+
FROM golang:1.16.4
42

53
RUN apt-get update
64
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.14.7
1+
FROM golang:1.16.4
22
LABEL maintainer="github@github.com"
33

44
RUN apt-get update

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gh-ost
22

3-
[![build status](https://travis-ci.org/github/gh-ost.svg)](https://travis-ci.org/github/gh-ost) [![downloads](https://img.shields.io/github/downloads/github/gh-ost/total.svg)](https://github.com/github/gh-ost/releases) [![release](https://img.shields.io/github/release/github/gh-ost.svg)](https://github.com/github/gh-ost/releases)
3+
[![ci](https://github.com/github/gh-ost/actions/workflows/ci.yml/badge.svg)](https://github.com/github/gh-ost/actions/workflows/ci.yml) [![replica-tests](https://github.com/github/gh-ost/actions/workflows/replica-tests.yml/badge.svg)](https://github.com/github/gh-ost/actions/workflows/replica-tests.yml) [![downloads](https://img.shields.io/github/downloads/github/gh-ost/total.svg)](https://github.com/github/gh-ost/releases) [![release](https://img.shields.io/github/release/github/gh-ost.svg)](https://github.com/github/gh-ost/releases)
44

55
#### GitHub's online schema migration for MySQL <img src="doc/images/gh-ost-logo-light-160.png" align="right">
66

@@ -65,6 +65,7 @@ Also see:
6565
- [the fine print](doc/the-fine-print.md)
6666
- [Community questions](https://github.com/github/gh-ost/issues?q=label%3Aquestion)
6767
- [Using `gh-ost` on AWS RDS](doc/rds.md)
68+
- [Using `gh-ost` on Azure Database for MySQL](doc/azure.md)
6869

6970
## What's in a name?
7071

@@ -94,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d
9495

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

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

RELEASE_VERSION

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

build.sh

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

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

26+
# TODO: remove GO111MODULE once gh-ost uses Go modules
2627
echo "Building ${osname} binary"
2728
export GOOS
2829
export GOARCH
29-
go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
30+
GO111MODULE=off go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
3031

3132
if [ $? -ne 0 ]; then
3233
echo "Build failed for ${osname}"
@@ -40,7 +41,7 @@ function build {
4041
builddir=$(setuptree)
4142
cp $buildpath/$target $builddir/gh-ost/usr/bin
4243
cd $buildpath
43-
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'shlomi-noach <shlomi-noach+gh-ost-deb@github.com>' --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 <shlomi-noach+gh-ost-deb@github.com>' --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 --rpm-rpmbuild-define "_build_id_links none" .
4445
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'shlomi-noach <shlomi-noach+gh-ost-deb@github.com>' --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 .
4546
fi
4647
}

doc/azure.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
`gh-ost` has been updated to work with Azure Database for MySQL however due to GitHub does not use it, this documentation is community driven so if you find a bug please [open an issue][new_issue]!
2+
3+
# Azure Database for MySQL
4+
5+
## Limitations
6+
7+
- `gh-ost` runs should be setup use [`--assume-rbr`][assume_rbr_docs] and use `binlog_row_image=FULL`.
8+
- Azure Database for MySQL does not use same user name suffix for master and replica, so master host, user and password need to be pointed out.
9+
10+
## Step
11+
1. Change the replica server's `binlog_row_image` from `MINIMAL` to `FULL`. See [guide](https://docs.microsoft.com/en-us/azure/mysql/howto-server-parameters) on Azure document.
12+
2. Use your `gh-ost` always with additional 5 parameter
13+
```{bash}
14+
gh-ost \
15+
--azure \
16+
--assume-master-host=master-server-dns-name \
17+
--master-user="master-user-name" \
18+
--master-password="master-password" \
19+
--assume-rbr \
20+
[-- other paramters you need]
21+
```
22+
23+
24+
[new_issue]: https://github.com/github/gh-ost/issues/new
25+
[assume_rbr_docs]: https://github.com/github/gh-ost/blob/master/doc/command-line-flags.md#assume-rbr
26+
[migrate_test_on_replica_docs]: https://github.com/github/gh-ost/blob/master/doc/cheatsheet.md#c-migratetest-on-replica

doc/command-line-flags.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ A more in-depth discussion of various `gh-ost` command line flags: implementatio
66

77
Add this flag when executing on Aliyun RDS.
88

9+
### azure
10+
11+
Add this flag when executing on Azure Database for MySQL.
12+
913
### allow-master-master
1014

1115
See [`--assume-master-host`](#assume-master-host).
@@ -177,6 +181,9 @@ Optionally involve the process ID, for example: `--replica-server-id=$((10000000
177181
It's on you to choose a number that does not collide with another `gh-ost` or another running replica.
178182
See also: [`concurrent-migrations`](cheatsheet.md#concurrent-migrations) on the cheatsheet.
179183

184+
### serve-socket-file
185+
186+
Defaults to an auto-determined and advertised upon startup file. Defines Unix socket file to serve on.
180187
### skip-foreign-key-checks
181188

182189
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`.

doc/hooks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The following variables are available on all hooks:
6666
- `GH_OST_ESTIMATED_ROWS` - estimated total rows in table
6767
- `GH_OST_COPIED_ROWS` - number of rows copied by `gh-ost`
6868
- `GH_OST_INSPECTED_LAG` - lag in seconds (floating point) of inspected server
69+
- `GH_OST_HEARTBEAT_LAG` - lag in seconds (floating point) of heartbeat
6970
- `GH_OST_PROGRESS` - progress pct ([0..100], floating point) of migration
7071
- `GH_OST_MIGRATED_HOST`
7172
- `GH_OST_INSPECTED_HOST`

0 commit comments

Comments
 (0)