You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove dead Applier.AttemptInstantDDL, update docs, add local test
Remove the now-unused AttemptInstantDDL() method from Applier since instant
DDL is handled by attemptInstantDDLEarly() in the Migrator.
Update command-line-flags.md to document the new early execution behavior of
--attempt-instant-ddl and add documentation for --force-instant-ddl.
Add localtests/force-instant-ddl with an instant-compatible ALTER to exercise
the --force-instant-ddl success path.
Copy file name to clipboardExpand all lines: doc/command-line-flags.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,10 +62,18 @@ MySQL 8.0 supports "instant DDL" for some operations. If an alter statement can
62
62
63
63
It is not reliable to parse the `ALTER` statement to determine if it is instant or not. This is because the table might be in an older row format, or have some other incompatibility that is difficult to identify.
64
64
65
+
When `--attempt-instant-ddl` is enabled, `gh-ost` will attempt `ALGORITHM=INSTANT`**early**, right after connecting to the inspector and before creating ghost tables or starting binlog streaming. If instant DDL succeeds, the migration completes immediately without any of the normal setup overhead. This is especially beneficial for large tables where the ghost table creation and binlog streaming setup would otherwise add significant time.
66
+
65
67
`--attempt-instant-ddl` is disabled by default, but the risks of enabling it are relatively minor: `gh-ost` may need to acquire a metadata lock at the start of the operation. This is not a problem for most scenarios, but it could be a problem for users that start the DDL during a period with long running transactions.
66
68
67
69
`gh-ost` will automatically fallback to the normal DDL process if the attempt to use instant DDL is unsuccessful.
68
70
71
+
### force-instant-ddl
72
+
73
+
`--force-instant-ddl` requires instant DDL to succeed. If `ALGORITHM=INSTANT` is not supported for the given operation, `gh-ost` will abort the migration immediately instead of falling back to a regular row-copy migration. This is useful when you intend an instant metadata-only change and want to prevent accidental multi-hour migrations on large tables.
74
+
75
+
Implies `--attempt-instant-ddl`. Ignored with `--revert`.
76
+
69
77
### binlogsyncer-max-reconnect-attempts
70
78
`--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`
0 commit comments