gh-ost
gh-ost copied to clipboard
About adding unique index lost data - There are delete operation scenarios
Is it possible to solve this scenario?
Add two calculators when there is a delete operation.
-
The deletion times of the original table are recorded in delete1
-
The deletion times of the new table are recorded in delete2
When cut-over:
- Count the total number of rows in the original table and record it to count1. Get the value of delete1 and calculate: res1=count1-delete1
- Count the total number of rows in the new table and record it to count2. Get the value of delete2 and calculate: res2=count2-delete2
When res1 is equal to res2, no data will be lost.
reference only
:wave: @suyestyle this might be possible to do during the atomic cut-over but it would cause a delay in the cutover. We have another approach that we use at GitHub - we continuously run test migrations against real data using replicas dedicated to testing gh-ost, which gives us confidence that we're not losing data during migrations.
👋 @suyestyle this might be possible to do during the atomic cut-over but it would cause a delay in the cutover. We have another approach that we use at GitHub - we continuously run test migrations against real data using replicas dedicated to testing gh-ost, which gives us confidence that we're not losing data during migrations.
This is great.
Will this feature be added in the next stable release?