Skip to content

Commit 29e3d48

Browse files
authored
Merge branch 'master' into master
2 parents ef686a4 + 49270ee commit 29e3d48

25 files changed

+130
-17
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# http://docs.travis-ci.com/user/languages/go/
22
language: go
33

4-
go: 1.9
4+
go:
5+
- "1.9"
6+
- "1.10"
57

68
os:
79
- linux

RELEASE_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.46
1+
1.0.47

doc/command-line-flags.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
A more in-depth discussion of various `gh-ost` command line flags: implementation, implication, use cases.
44

5+
### aliyun-rds
6+
7+
Add this flag when executing on Aliyun RDS.
8+
59
### allow-master-master
610

711
See [`--assume-master-host`](#assume-master-host).
@@ -103,6 +107,10 @@ While the ongoing estimated number of rows is still heuristic, it's almost exact
103107

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

110+
### gcp
111+
112+
Add this flag when executing on a 1st generation Google Cloud Platform (GCP).
113+
106114
### heartbeat-interval-millis
107115

108116
Default 100. See [`subsecond-lag`](subsecond-lag.md) for details.

doc/hooks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ The following variables are available on all hooks:
6969
- `GH_OST_INSPECTED_HOST`
7070
- `GH_OST_EXECUTING_HOST`
7171
- `GH_OST_HOOKS_HINT` - copy of `--hooks-hint` value
72+
- `GH_OST_DRY_RUN` - whether or not the `gh-ost` run is a dry run
7273

7374
The following variable are available on particular hooks:
7475

doc/requirements-and-limitations.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ The `SUPER` privilege is required for `STOP SLAVE`, `START SLAVE` operations. Th
3939
- For example, you may not migrate `MyTable` if another table called `MYtable` exists in the same schema.
4040

4141
- Amazon RDS works, but has it's own [limitations](rds.md).
42-
- Google Cloud SQL is currently not supported
42+
- Google Cloud SQL works, `--gcp` flag required.
43+
- Aliyun RDS works, `--aliyun-rds` flag required.
4344

4445
- Multisource is not supported when migrating via replica. It _should_ work (but never tested) when connecting directly to master (`--allow-on-master`)
4546

doc/shared-key.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A requirement for a migration to run is that the two _before_ and _after_ tables
66

77
Consider a classic, simple migration. The table is any normal:
88

9-
```
9+
```sql
1010
CREATE TABLE tbl (
1111
id bigint unsigned not null auto_increment,
1212
data varchar(255),
@@ -37,7 +37,7 @@ Upon migration, `gh-ost` inspects both the original and _ghost_ table and attemp
3737

3838
### Examples: allowed and not allowed
3939

40-
```
40+
```sql
4141
create table some_table (
4242
id int auto_increment,
4343
ts timestamp,

go/base/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type MigrationContext struct {
9292
IsTungsten bool
9393
DiscardForeignKeys bool
9494
AliyunRDS bool
95+
GoogleCloudPlatform bool
9596

9697
config ContextConfig
9798
configMutex *sync.Mutex

go/base/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ func ValidateConnection(db *gosql.DB, connectionConfig *mysql.ConnectionConfig,
7575
// swallow this error. not all servers support extra_port
7676
}
7777
// AliyunRDS set users port to "NULL", replace it by gh-ost param
78-
if migrationContext.AliyunRDS {
78+
// GCP set users port to "NULL", replace it by gh-ost param
79+
if migrationContext.AliyunRDS || migrationContext.GoogleCloudPlatform {
7980
port = connectionConfig.Key.Port
8081
} else {
8182
portQuery := `select @@global.port`

go/binlog/gomysql_reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (this *GoMySQLReader) StreamEvents(canStopStreaming func() bool, entriesCha
145145
defer this.currentCoordinatesMutex.Unlock()
146146
this.currentCoordinates.LogFile = string(rotateEvent.NextLogName)
147147
}()
148-
log.Infof("rotate to next log name: %s", rotateEvent.NextLogName)
148+
log.Infof("rotate to next log from %s:%d to %s", this.currentCoordinates.LogFile, int64(ev.Header.LogPos), rotateEvent.NextLogName)
149149
} else if rowsEvent, ok := ev.Event.(*replication.RowsEvent); ok {
150150
if err := this.handleRowsEvent(ev, rowsEvent, entriesChannel); err != nil {
151151
return err

go/cmd/gh-ost/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func main() {
6868
flag.BoolVar(&migrationContext.DiscardForeignKeys, "discard-foreign-keys", false, "DANGER! This flag will migrate a table that has foreign keys and will NOT create foreign keys on the ghost table, thus your altered table will have NO foreign keys. This is useful for intentional dropping of foreign keys")
6969
flag.BoolVar(&migrationContext.SkipForeignKeyChecks, "skip-foreign-key-checks", false, "set to 'true' when you know for certain there are no foreign keys on your table, and wish to skip the time it takes for gh-ost to verify that")
7070
flag.BoolVar(&migrationContext.AliyunRDS, "aliyun-rds", false, "set to 'true' when you execute on Aliyun RDS.")
71+
flag.BoolVar(&migrationContext.GoogleCloudPlatform, "gcp", false, "set to 'true' when you execute on a 1st generation Google Cloud Platform (GCP).")
7172

7273
executeFlag := flag.Bool("execute", false, "actually execute the alter & migrate the table. Default is noop: do some tests and exit")
7374
flag.BoolVar(&migrationContext.TestOnReplica, "test-on-replica", false, "Have the migration run on a replica, not on the master. At the end of migration replication is stopped, and tables are swapped and immediately swap-revert. Replication remains stopped and you can compare the two tables for building trust")

0 commit comments

Comments
 (0)