-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot handle a rare case for flash back table #1664
Labels
Comments
I've met another corner case that will lose data quietly after flash back a table: How to reproduceDo not execute ### Test case for applying raft snapshot for tombstoned table
mysql> create table test.t(id int);
# It is important that TiFlash has synced the table schema
>> DBGInvoke __refresh_schemas() <--- comment out this line
# Insert some record
mysql> insert into test.t values (3),(4);
# Enable the failpoint and make it pause before applying the raft snapshot
>> DBGInvoke __init_fail_point()
>> DBGInvoke __enable_fail_point(pause_before_apply_raft_snapshot)
>> DBGInvoke __enable_fail_point(pause_until_apply_raft_snapshot)
mysql> alter table test.t set tiflash replica 1;
# Drop table and force sync schema to make sure table in TiFlash is tombstoned.
mysql> drop table test.t;
>> DBGInvoke __refresh_schemas()
# Wait for a while so that the region snapshot is sent to TiFlash by the Region leader
SLEEP 3
# Disable the failpoint to apply writes even if the storage is tombstoned.
>> DBGInvoke __disable_fail_point(pause_before_apply_raft_snapshot)
# Wait till the snapshot is applied
>> DBGInvoke __wait_fail_point(pause_until_apply_raft_snapshot)
# Recover table and force sync schema to make sure table in TiFlash is recovered.
mysql> recover table test.t;
>> DBGInvoke __refresh_schemas()
func> wait_table test t
# Read again, the record should appear.
mysql> set session tidb_isolation_read_engines='tiflash'; select * from test.t; <-- Only 0 row can be selected from TiFlash
+------+
| id |
+------+
| 3 |
| 4 |
+------+
mysql> drop table if exists test.t; Why data is lost
|
12 tasks
12 tasks
12 tasks
This was referenced Nov 30, 2023
JaySon-Huang
added a commit
to ti-chi-bot/tiflash
that referenced
this issue
Nov 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current tombstone + flash back strategy cannot handle the following rare case:
In such a case, TiFlash won't be able to decode this row and errors out "overflow detected".
But as you can see, this is a extremely rare case.
The text was updated successfully, but these errors were encountered: