github / github/gh-ost

About adding unique index lost data - There are delete operation scenarios

Open
#1,205 3 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

Is it possible to solve this scenario?

Add two calculators when there is a delete operation.

1. The deletion times of the original table are recorded in **delete1**

2. The deletion times of the new table are recorded in **delete2**

When cut-over:

1. 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**
2. 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.

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.