Skip to content

Commit d8ccc11

Browse files
eddroiddm-2
authored andcommitted
v1.1.3
1 parent aef2a69 commit d8ccc11

File tree

10 files changed

+37
-20
lines changed

10 files changed

+37
-20
lines changed

RELEASE_VERSION

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

build.sh

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

21-
if ! go version | egrep -q 'go(1\.1[56])' ; then
21+
if ! go version | egrep -q 'go1\.(1[5-9]|[2-9][0-9]{1})' ; then
2222
echo "go version must be 1.15 or above"
2323
exit 1
2424
fi
@@ -41,8 +41,9 @@ function build {
4141
builddir=$(setuptree)
4242
cp $buildpath/$target $builddir/gh-ost/usr/bin
4343
cd $buildpath
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 rpm --rpm-rpmbuild-define "_build_id_links none" .
45-
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 .
44+
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'GitHub' --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" .
45+
fpm -v "${RELEASE_VERSION}" --epoch 1 -f -s dir -n gh-ost -m 'GitHub' --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 .
46+
cd -
4647
fi
4748
}
4849

@@ -63,10 +64,16 @@ main() {
6364
mkdir -p ${buildpath}
6465
rm -rf ${buildpath:?}/*
6566
build GNU/Linux linux linux amd64
66-
# build macOS osx darwin amd64
67+
build macOS osx darwin amd64
6768

6869
echo "Binaries found in:"
6970
find $buildpath/gh-ost* -type f -maxdepth 1
71+
72+
echo "Checksums:"
73+
(cd $buildpath && shasum -a256 gh-ost* 2>/dev/null)
7074
}
7175

76+
. script/bootstrap
77+
cd .gopath/src/github.com/github/gh-ost
78+
7279
main "$@"

doc/command-line-flags.md

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

2323
### approve-renamed-columns
2424

25-
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.
25+
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.
2626

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

@@ -32,7 +32,7 @@ If you think `gh-ost` is mistaken and that there's actually no _rename_ involved
3232

3333
`gh-ost` infers the identity of the master server by crawling up the replication topology. You may explicitly tell `gh-ost` the identity of the master host via `--assume-master-host=the.master.com`. This is useful in:
3434

35-
- _master-master_ topologies (together with [`--allow-master-master`](#allow-master-master)), where `gh-ost` can arbitrarily pick one of the co-masters and you prefer that it picks a specific one
35+
- _master-master_ topologies (together with [`--allow-master-master`](#allow-master-master)), where `gh-ost` can arbitrarily pick one of the co-masters, and you prefer that it picks a specific one
3636
- _tungsten replicator_ topologies (together with [`--tungsten`](#tungsten)), where `gh-ost` is unable to crawl and detect the master
3737

3838
### assume-rbr
@@ -61,7 +61,13 @@ Comma delimited status-name=threshold, same format as [`--max-load`](#max-load).
6161

6262
`--critical-load` defines a threshold that, when met, `gh-ost` panics and bails out. The default behavior is to bail out immediately when meeting this threshold.
6363

64-
This may sometimes lead to migrations bailing out on a very short spike, that, while in itself is impacting production and is worth investigating, isn't reason enough to kill a 10 hour migration.
64+
This may sometimes lead to migrations bailing out on a very short spike, that, while in itself is impacting production and is worth investigating, isn't reason enough to kill a 10-hour migration.
65+
66+
### critical-load-hibernate-seconds
67+
68+
When `--critical-load-hibernate-seconds` is non-zero (e.g. `--critical-load-hibernate-seconds=300`), `critical-load` does not panic and bail out; instead, `gh-ost` goes into hibernation for the specified duration. It will not read/write anything from/to any server during this time. Execution then continues upon waking from hibernation.
69+
70+
If `critical-load` is met again, `gh-ost` will repeat this cycle, and never panic and bail out.
6571

6672
### critical-load-interval-millis
6773

@@ -98,7 +104,7 @@ Noteworthy is that setting `--dml-batch-size` to higher value _does not_ mean `g
98104

99105
### exact-rowcount
100106

101-
A `gh-ost` execution need to copy whatever rows you have in your existing table onto the ghost table. This can, and often be, a large number. Exactly what that number is?
107+
A `gh-ost` execution need to copy whatever rows you have in your existing table onto the ghost table. This can and often will be, a large number. Exactly what that number is?
102108
`gh-ost` initially estimates the number of rows in your table by issuing an `explain select * from your_table`. This will use statistics on your table and return with a rough estimate. How rough? It might go as low as half or as high as double the actual number of rows in your table. This is the same method as used in [`pt-online-schema-change`](https://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html).
103109

104110
`gh-ost` also supports the `--exact-rowcount` flag. When this flag is given, two things happen:
@@ -230,7 +236,7 @@ Provide a command delimited list of replicas; `gh-ost` will throttle when any of
230236

231237
### throttle-http
232238

233-
Provide a HTTP endpoint; `gh-ost` will issue `HEAD` requests on given URL and throttle whenever response status code is not `200`. The URL can be queried and updated dynamically via [interactive commands](interactive-commands.md). Empty URL disables the HTTP check.
239+
Provide an HTTP endpoint; `gh-ost` will issue `HEAD` requests on given URL and throttle whenever response status code is not `200`. The URL can be queried and updated dynamically via [interactive commands](interactive-commands.md). Empty URL disables the HTTP check.
234240

235241
### timestamp-old-table
236242

doc/hooks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The following variables are available on all hooks:
6868
- `GH_OST_INSPECTED_LAG` - lag in seconds (floating point) of inspected server
6969
- `GH_OST_HEARTBEAT_LAG` - lag in seconds (floating point) of heartbeat
7070
- `GH_OST_PROGRESS` - progress pct ([0..100], floating point) of migration
71+
- `GH_OST_ETA_SECONDS` - estimated duration until migration finishes in seconds
7172
- `GH_OST_MIGRATED_HOST`
7273
- `GH_OST_INSPECTED_HOST`
7374
- `GH_OST_EXECUTING_HOST`

doc/triggerless-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ It is also interesting to observe that `gh-ost` is the only application writing
112112

113113
When `gh-ost` pauses (throttles), it issues no writes on the ghost table. Because there are no triggers, write workload is decoupled from the `gh-ost` write workload. And because we're using an asynchronous approach, the algorithm already handles a time difference between a master write time and the ghost apply time. A difference of a few microseconds is no different from a difference of minutes or hours.
114114

115-
When `gh-ost` [throttles](throttle.md), either by replication lag, `max-load` setting or and explicit [interactive user command](interactive-commands.md), the master is back to normal. It sees no more writes on the ghost table.
115+
When `gh-ost` [throttles](throttle.md), either by replication lag, `max-load` setting or an explicit [interactive user command](interactive-commands.md), the master is back to normal. It sees no more writes on the ghost table.
116116
An exception is the ongoing heartbeat writes onto the changelog table, which we consider to be negligible.
117117

118118
#### Testability

go/cmd/gh-ost/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package main
88
import (
99
"flag"
1010
"fmt"
11+
"net/url"
1112
"os"
1213
"os/signal"
1314
"syscall"
@@ -130,7 +131,7 @@ func main() {
130131
maxLoad := flag.String("max-load", "", "Comma delimited status-name=threshold. e.g: 'Threads_running=100,Threads_connected=500'. When status exceeds threshold, app throttles writes")
131132
criticalLoad := flag.String("critical-load", "", "Comma delimited status-name=threshold, same format as --max-load. When status exceeds threshold, app panics and quits")
132133
flag.Int64Var(&migrationContext.CriticalLoadIntervalMilliseconds, "critical-load-interval-millis", 0, "When 0, migration immediately bails out upon meeting critical-load. When non-zero, a second check is done after given interval, and migration only bails out if 2nd check still meets critical load")
133-
flag.Int64Var(&migrationContext.CriticalLoadHibernateSeconds, "critical-load-hibernate-seconds", 0, "When nonzero, critical-load does not panic and bail out; instead, gh-ost goes into hibernate for the specified duration. It will not read/write anything to from/to any server")
134+
flag.Int64Var(&migrationContext.CriticalLoadHibernateSeconds, "critical-load-hibernate-seconds", 0, "When non-zero, critical-load does not panic and bail out; instead, gh-ost goes into hibernation for the specified duration. It will not read/write anything from/to any server")
134135
quiet := flag.Bool("quiet", false, "quiet")
135136
verbose := flag.Bool("verbose", false, "verbose")
136137
debug := flag.Bool("debug", false, "debug mode (very verbose)")
@@ -188,6 +189,11 @@ func main() {
188189
log.Fatalf("--database must be provided and database name must not be empty, or --alter must specify database name")
189190
}
190191
}
192+
193+
if err := flag.Set("database", url.QueryEscape(migrationContext.DatabaseName)); err != nil {
194+
migrationContext.Log.Fatale(err)
195+
}
196+
191197
if migrationContext.OriginalTableName == "" {
192198
if parser.HasExplicitTable() {
193199
migrationContext.OriginalTableName = parser.GetExplicitTable()

script/bootstrap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set -e
1010
# Since we want to be able to build this outside of GOPATH, we set it
1111
# up so it points back to us and go is none the wiser
1212

13-
set -x
1413
rm -rf .gopath
1514
mkdir -p .gopath/src/github.com/github
1615
ln -s "$PWD" .gopath/src/github.com/github/gh-ost

script/ensure-go-installed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
PREFERRED_GO_VERSION=go1.16.4
4-
SUPPORTED_GO_VERSIONS='go1.1[56]'
4+
SUPPORTED_GO_VERSIONS='go1.1[567]'
55

66
GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
77
GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b
@@ -35,7 +35,7 @@ if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")"
3535
curl -L -O https://dl.google.com/go/$GO_PKG_DARWIN
3636
shasum -a256 $GO_PKG_DARWIN | grep $GO_PKG_DARWIN_SHA
3737
xar -xf $GO_PKG_DARWIN
38-
cpio -i < com.googlecode.go.pkg/Payload
38+
cpio -i < org.golang.go.pkg/Payload
3939
else
4040
curl -L -O https://dl.google.com/go/$GO_PKG_LINUX
4141
shasum -a256 $GO_PKG_LINUX | grep $GO_PKG_LINUX_SHA

vendor/github.com/siddontang/go-mysql/client/resp.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/siddontang/go-mysql/packet/conn.go

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)