Skip to content

Commit 2f70faf

Browse files
Merge branch 'master' into feat/cle/add-optimizer-switch
2 parents 73bbd54 + 5ebb953 commit 2f70faf

File tree

297 files changed

+47871
-15979
lines changed

Some content is hidden

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

297 files changed

+47871
-15979
lines changed

.github/workflows/codeql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v2
2020

2121
- name: Initialize CodeQL
22-
uses: github/codeql-action/init@v1
22+
uses: github/codeql-action/init@v2
2323

2424
- name: Perform CodeQL Analysis
25-
uses: github/codeql-action/analyze@v1
25+
uses: github/codeql-action/analyze@v2

Dockerfile.packaging

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM golang:1.17
1+
FROM golang:1.17-stretch
2+
3+
# Update stretch repositories
4+
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
5+
-e 's|security.debian.org|archive.debian.org/|g' \
6+
-e '/stretch-updates/d' /etc/apt/sources.list
27

38
RUN apt-get update
49
RUN apt-get install -y ruby ruby-dev rubygems build-essential

Dockerfile.test

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
FROM golang:1.17
1+
FROM golang:1.17-stretch
22
LABEL maintainer="[email protected]"
33

4+
#Update stretch repositories
5+
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
6+
-e 's|security.debian.org|archive.debian.org/|g' \
7+
-e '/stretch-updates/d' /etc/apt/sources.list
8+
49
RUN apt-get update
510
RUN apt-get install -y lsb-release
611
RUN rm -rf /var/lib/apt/lists/*

RELEASE_VERSION

-1
This file was deleted.

build.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ main() {
5252
RELEASE_VERSION=$(git describe --abbrev=0 --tags | tr -d 'v')
5353
fi
5454
if [ -z "${RELEASE_VERSION}" ] ; then
55-
RELEASE_VERSION=$(cat RELEASE_VERSION)
55+
echo "RELEASE_VERSION must be set"
56+
exit 1
5657
fi
5758

59+
if [ -z "${GIT_COMMIT}" ]; then
60+
GIT_COMMIT=$(git rev-parse HEAD)
61+
fi
5862

5963
buildpath=/tmp/gh-ost-release
6064
target=gh-ost
6165
timestamp=$(date "+%Y%m%d%H%M%S")
62-
ldflags="-X main.AppVersion=${RELEASE_VERSION}"
66+
ldflags="-X main.AppVersion=${RELEASE_VERSION} -X main.GitCommit=${GIT_COMMIT}"
6367

6468
mkdir -p ${buildpath}
6569
rm -rf ${buildpath:?}/*

doc/azure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ gh-ost \
1717
--master-user="master-user-name" \
1818
--master-password="master-password" \
1919
--assume-rbr \
20-
[-- other paramters you need]
20+
[-- other parameters you need]
2121
```
2222

2323

2424
[new_issue]: https://github.com/github/gh-ost/issues/new
2525
[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
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

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ It is not reliable to parse the `ALTER` statement to determine if it is instant
6161

6262
`gh-ost` will automatically fallback to the normal DDL process if the attempt to use instant DDL is unsuccessful.
6363

64+
### binlogsyncer-max-reconnect-attempts
65+
`--binlogsyncer-max-reconnect-attempts=0`, the maximum number of attempts to re-establish a broken inspector connection for sync binlog. `0` or `negative number` means infinite retry, default `0`
66+
6467
### conf
6568

6669
`--conf=/path/to/my.cnf`: file where credentials are specified. Should be in (or contain) the following format:

go.mod

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ require (
88
github.com/go-sql-driver/mysql v1.6.0
99
github.com/openark/golib v0.0.0-20210531070646-355f37940af8
1010
github.com/satori/go.uuid v1.2.0
11-
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
12-
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
13-
golang.org/x/text v0.3.6
11+
golang.org/x/net v0.17.0
12+
golang.org/x/term v0.13.0
13+
golang.org/x/text v0.13.0
1414
)
1515

1616
require (
@@ -20,8 +20,7 @@ require (
2020
github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 // indirect
2121
github.com/smartystreets/goconvey v1.6.4 // indirect
2222
go.uber.org/atomic v1.7.0 // indirect
23-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
24-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
23+
golang.org/x/sys v0.13.0 // indirect
2524
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
2625
gopkg.in/ini.v1 v1.62.0 // indirect
2726
)

go.sum

+31-12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
6666
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
6767
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
6868
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
69+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
6970
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
7071
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
7172
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
@@ -81,37 +82,53 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
8182
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
8283
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
8384
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
84-
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
85-
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
85+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
86+
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
8687
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
8788
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
8889
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
90+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
91+
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
8992
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
9093
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
9194
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
9295
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
93-
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM=
94-
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
96+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
97+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
98+
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
99+
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
100+
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
101+
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
95102
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
96103
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
104+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
105+
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
97106
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
98107
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
99-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
100108
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
101-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
102109
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
103-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
104110
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
105-
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
106-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
111+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
112+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
113+
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
114+
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
115+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
116+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
107117
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
108-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
109-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
118+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
119+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
120+
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
121+
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
122+
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
110123
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
111124
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
112125
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
113-
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
114126
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
127+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
128+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
129+
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
130+
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
131+
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
115132
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
116133
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
117134
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
@@ -120,6 +137,8 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn
120137
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
121138
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
122139
golang.org/x/tools v0.0.0-20201125231158-b5590deeca9b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
140+
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
141+
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
123142
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
124143
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
125144
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

go/base/context.go

+2
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ type MigrationContext struct {
233233

234234
recentBinlogCoordinates mysql.BinlogCoordinates
235235

236+
BinlogSyncerMaxReconnectAttempts int
237+
236238
Log Logger
237239
}
238240

go/binlog/gomysql_reader.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"github.com/github/gh-ost/go/mysql"
1414
"github.com/github/gh-ost/go/sql"
1515

16+
"time"
17+
1618
gomysql "github.com/go-mysql-org/go-mysql/mysql"
1719
"github.com/go-mysql-org/go-mysql/replication"
1820
"golang.org/x/net/context"
@@ -36,14 +38,16 @@ func NewGoMySQLReader(migrationContext *base.MigrationContext) *GoMySQLReader {
3638
currentCoordinates: mysql.BinlogCoordinates{},
3739
currentCoordinatesMutex: &sync.Mutex{},
3840
binlogSyncer: replication.NewBinlogSyncer(replication.BinlogSyncerConfig{
39-
ServerID: uint32(migrationContext.ReplicaServerId),
40-
Flavor: gomysql.MySQLFlavor,
41-
Host: connectionConfig.Key.Hostname,
42-
Port: uint16(connectionConfig.Key.Port),
43-
User: connectionConfig.User,
44-
Password: connectionConfig.Password,
45-
TLSConfig: connectionConfig.TLSConfig(),
46-
UseDecimal: true,
41+
ServerID: uint32(migrationContext.ReplicaServerId),
42+
Flavor: gomysql.MySQLFlavor,
43+
Host: connectionConfig.Key.Hostname,
44+
Port: uint16(connectionConfig.Key.Port),
45+
User: connectionConfig.User,
46+
Password: connectionConfig.Password,
47+
TLSConfig: connectionConfig.TLSConfig(),
48+
UseDecimal: true,
49+
MaxReconnectAttempts: migrationContext.BinlogSyncerMaxReconnectAttempts,
50+
TimestampStringLocation: time.UTC,
4751
}),
4852
}
4953
}

go/cmd/gh-ost/main.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"golang.org/x/term"
2323
)
2424

25-
var AppVersion string
25+
var AppVersion, GitCommit string
2626

2727
// acceptSignals registers for OS signals
2828
func acceptSignals(migrationContext *base.MigrationContext) {
@@ -134,6 +134,7 @@ func main() {
134134
flag.Int64Var(&migrationContext.HooksStatusIntervalSec, "hooks-status-interval", 60, "how many seconds to wait between calling onStatus hook")
135135

136136
flag.UintVar(&migrationContext.ReplicaServerId, "replica-server-id", 99999, "server id used by gh-ost process. Default: 99999")
137+
flag.IntVar(&migrationContext.BinlogSyncerMaxReconnectAttempts, "binlogsyncer-max-reconnect-attempts", 0, "when master node fails, the maximum number of binlog synchronization attempts to reconnect. 0 is unlimited")
137138

138139
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")
139140
criticalLoad := flag.String("critical-load", "", "Comma delimited status-name=threshold, same format as --max-load. When status exceeds threshold, app panics and quits")
@@ -165,7 +166,7 @@ func main() {
165166
if appVersion == "" {
166167
appVersion = "unversioned"
167168
}
168-
fmt.Println(appVersion)
169+
fmt.Printf("%s (git commit: %s)", appVersion, GitCommit)
169170
return
170171
}
171172

@@ -308,7 +309,7 @@ func main() {
308309
migrationContext.Log.Errore(err)
309310
}
310311

311-
log.Infof("starting gh-ost %+v", AppVersion)
312+
log.Infof("starting gh-ost %+v (git commit: %s)", AppVersion, GitCommit)
312313
acceptSignals(migrationContext)
313314

314315
migrator := logic.NewMigrator(migrationContext, AppVersion)

0 commit comments

Comments
 (0)