Skip to content

Commit 90a14d5

Browse files
Merge branch 'master' into tar-xz-dbdeployer-upgrade
2 parents 1f99b64 + 29b8cfa commit 90a14d5

68 files changed

Lines changed: 1637 additions & 825 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: 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.15
1414
uses: actions/setup-go@v1
1515
with:
16-
version: 1.12
17-
id: go
16+
go-version: 1.15
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

.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/

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.15.6
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: 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.15.6
22
LABEL maintainer="github@github.com"
33

44
RUN apt-get update

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.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:
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

@@ -109,3 +110,4 @@ Generally speaking, `master` branch is stable, but only [releases](https://githu
109110
- [@shlomi-noach](https://github.com/shlomi-noach)
110111
- [@jessbreckenridge](https://github.com/jessbreckenridge)
111112
- [@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.48
1+
1.1.1

build.sh

Lines changed: 5 additions & 5 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

@@ -40,7 +40,7 @@ function build {
4040
builddir=$(setuptree)
4141
cp $buildpath/$target $builddir/gh-ost/usr/bin
4242
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 .
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 --rpm-rpmbuild-define "_build_id_links none" .
4444
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 .
4545
fi
4646
}
@@ -61,11 +61,11 @@ main() {
6161

6262
mkdir -p ${buildpath}
6363
rm -rf ${buildpath:?}/*
64-
build macOS osx darwin amd64
6564
build GNU/Linux linux linux amd64
65+
# build macOS osx darwin amd64
6666

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

7171
main "$@"

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

0 commit comments

Comments
 (0)