github / github/gh-ost

Delete records not in sync between table and gho table

Open
#1,142 4 comments 2 reactions 0 assignees View on GitHub
data-integrity
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

We recently had an issue where we discovered that a gh-ost migration that was run on a table wasn't syncing DELETEs between the table being migrated from and the new table. I was able to replicate the issue in our staging environment, and it was very clear that the two tables were out of sync while the migration was being run.

Is there anything we're missing on our end? Did we misunderstand that gh-ost should be keeping those tables in sync during a migration?

```
./gh-ost \
--user="user" \
--password="pass" \
--host=host \
--database="db" \
--table="ourTable" \
--allow-on-master \
--verbose \
--postpone-cut-over-flag-file="./postpone-cut.txt" \
--discard-foreign-keys \
--alter="PARTITION BY HASH(parkId) PARTITIONS 101" \
--initially-drop-ghost-table \
--timestamp-old-table \
--execute
```

This is the command that we ran. We use RDS with bin_log format = ROW, if that helps

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.