Move table mode for gh-ost
Les mainteneurs répondent en général sous 10 jours
@ericyan y travaille déjà.
Depuis le 18/8/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
This document specifies the work needed inside gh-ost to support a new move table mode, in which one or more tables are copied from a source MySQL cluster to a target MySQL cluster, with a cooperative cutover protocol coordinated via hooks.
Scope
In scope:
- One or more tables in a single gh-ost run, sharing one source binlog stream.
- GTID-only operation.
- gh-ost issues the source
RENAME TABLEitself; ACL changes and feature-flag flips are delegated to hook scripts.
Explicitly deferred or out of scope:
- Schema transformation (
--alter) combined with move. - File+position binlog drain (non-GTID).
- Inline checksumming or target-binlog monitoring (use
pt-table-checksumexternally). - Revert / rollback of a completed move.
- Source-side grant cleanup.
Design
Move table mode is enabled by a single new flag --move-tables=t1,t2,.... The mode reuses the existing inspector, binlog streamer, chunk iterator, throttler, hook executor, and checkpoint mechanism, while introducing a second database connection (the target), per-table runtime state, and a cooperative cutover protocol driven by gh-ost.
Architecture overview
┌──────────────────────┐ ┌──────────────────────┐
│ Source MySQL │ │ Target MySQL │
│ │ │ │
│ ┌─────────┐ │ │ ┌─────────┐ │
│ │ table_A │◄── Inspector reads ──┐ │ │ table_A │ │
│ │ table_B │ │ │ │ table_B │ │
│ └─────────┘ │ │ │ └─────────┘ │
│ │ │ │ ▲ │
│ Binlog ────────────────► EventsStreamer │ │ │
│ │ │ │ Applier writes ────┘
│ │ gh-ost │ │
│ │ process │ ┌─────────┐ │
│ │ │ │ │ _ghk │ │
│ │ └───────│──│checkpoint│ │
│ │ │ └─────────┘ │
└──────────────────────┘ └──────────────────────┘
Key principle: limit changes to the hot code path (eg. binlog streamer). All move-table-specific logic lives in higher layers — the migrator (cutover orchestration and multi-table iteration) and the applier (where it connects and what tables it writes to).
Connection model
| Connection | Standard mode | Move table mode |
|---|---|---|
| Inspector | reads from source | reads from source (unchanged) |
| Binlog streamer | reads from source | reads from source (unchanged) |
| Applier | writes to source-side master | writes to target master |
| Cutover | issues RENAME on source |
issues RENAME on source (short-lived, reuses inspector connection config) |
Cutover protocol
The read cutover is the application repoints its reads to the target while writes still flow to the source. The write cutover is the actual "cutover", in which gh-ost issues a single atomic RENAME TABLE on the source, captures @@gtid_executed as the drain marker, waits until the applier has reached that GTID, and fires on-success so the hook can unlock the target write user and flip the application's write feature flag.
- Langage dominant
- Go
- Étoiles
- 13.6k
- Forks
- 1.4k
- Merge moyen
- 9 j 19 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringPeut-être pris @ajm188 l’a pris il y a 56 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 10 jours
-
[Suggestion] Apply simple validation to alter commandPeut-être pris @drkemp187 l’a pris il y a 106 jours. Ouverteenhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
github/gh-ost#1431 · 4 commentaires ·
Les mainteneurs répondent en général sous 10 jours
-
Migration hangs when --attempt-instant-ddl succeedsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
Les mainteneurs répondent en général sous 10 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
Les mainteneurs répondent en général sous 10 jours
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
github/gh-ost#1780 · 1 commentaire ·
Les mainteneurs répondent en général sous 10 jours
Toutes les issues de github/gh-ost
Issues similaires
-
[Docs] Four internal links return 404 (Models concept, Contributing to Docs, Providers reference)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
meshery/meshery#23520 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
flaky: execenv TestRelayControlledCancelAndDirectParentDeath reads an empty pid file under loadOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
SocialGouv/iterion#3263 ·
Les mainteneurs répondent en général sous 1 jour
-
Container registry refuses image names with "__" or "--" (NAME_INVALID), which the OCI distribution spec allows since v1.1.0Peut-être pris @lazerg l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Unsupported language versionOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
itadori26/trisse-home#226 ·
Les mainteneurs répondent en général sous 1 jour