github / github/gh-ost

Data Inconsistency Issue after cutover

Open
#420 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

Hi All,
We just found an issue with our data consistency after doing cutover, when ghost copied 100% of the data to new table.

Here is the Command we have used for this migration-

```
./gh-ost --user="gh_user" --password="xxxxx" --allow-on-master --database="xxxxxx" --table="xxxxxxx" --verbose -max-lag-millis=50000 --alter="engine=innodb;" --throttle-control-replicas=pawslmktxxxxxx:3306,pawslmktxxxxxxx:3306 --initially-drop-ghost-table --initially-drop-old-table --max-load=Threads_running=30 --chunk-size=50000 --concurrent-rowcount --switch-to-rbr --postpone-cut-over-flag-file=/tmp/ghostcutover.file --execute
```

After cutover we found the in new table less numbers are inserted. Is there any case these inserts can be ignored while using gh-ost.

After copying all the data, we found that there is a mismatch in the number of rows of both the tables, original one and the ghost one. Here is the table counts.

```
mysql> select count(1) from sales_data;
+----------+
| count(1) |
+----------+
| 99426470 |
+----------+
1 row in set (0.00 sec)

mysql> select count(1) from _sales_data_gho;
+----------+
| count(1) |
+----------+
| 87669870 |
+----------+
1 row in set (0.00 sec)

mysql> select min(order_item_id) from sales_data;
+--------------------+
| min(order_item_id) |
+--------------------+
| 500000002 |
+--------------------+
1 row in set (0.00 sec)

mysql> select min(order_item_id) from _sales_data_gho;
+--------------------+
| min(order_item_id) |
+--------------------+
| 500000002 |
+--------------------+
1 row in set (0.00 sec)

mysql> select max(order_item_id) from sales_data;
+--------------------+
| max(order_item_id) |
+--------------------+
| 3456045067 |
+--------------------+
1 row in set (0.00 sec)

mysql> select max(order_item_id) from _sales_data_gho;
+--------------------+
| max(order_item_id) |
+--------------------+
| 3456045067 |
+--------------------+
1 row in set (0.00 sec)
```
Unfortunately we have missed the ghost screen output.

-Mayank Tyagi
+919971915405

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.