lightning: restoring dataset using auto-generated ID failed
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
mysql> create table test(id bigint unsigned auto_increment primary key, a int, b text, c text);
Query OK, 0 rows affected (0.10 sec)
mysql> alter table test auto_increment=9223372036854775802;
Query OK, 0 rows affected (0.11 sec)
```
```toml
[lightning]
# Logging
file = "/home/tidb-lightning1.log"
level = "debug"
check-requirements = false
[tikv-importer]
# Uses the Local-backend
backend = "local"
# Sets the directory for temporarily storing the sorted key-value pairs.
# The target directory must be empty.
# disk-quota = "500MB"
sorted-kv-dir = "/tmp/sst1"
incremental-import = true
```
data:
```csv
a,b,c
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
1,'a','b'
```
### 2. What did you expect to see? (Required)
1. restoring succeeded
```
mysql> insert into test(a,b,c) values(1,'a','b');
Query OK, 1 row affected (0.02 sec)
... repeat this
mysql> select * from test;
+---------------------+------+------+------+
| id | a | b | c |
+---------------------+------+------+------+
| 9223372036854775808 | 1 | a | b |
| 9223372036854775809 | 1 | a | b |
| 9223372036854775810 | 1 | a | b |
| 9223372036854775811 | 1 | a | b |
| 9223372036854775812 | 1 | a | b |
| 9223372036854775813 | 1 | a | b |
| 9223372036854775814 | 1 | a | b |
| 9223372036854775815 | 1 | a | b |
| 9223372036854775816 | 1 | a | b |
| 9223372036854775817 | 1 | a | b |
| 9223372036854775802 | 1 | a | b |
| 9223372036854775803 | 1 | a | b |
| 9223372036854775804 | 1 | a | b |
| 9223372036854775805 | 1 | a | b |
| 9223372036854775806 | 1 | a | b |
| 9223372036854775807 | 1 | a | b |
+---------------------+------+------+------+
```
### 3. What did you see instead (Required)
```
Verbose debug logs will be written to /home/tidb-lightning1.log
Error: [Lighting:Restore:ErrChecksumMismatch]checksum mismatched remote vs local => (checksum: 17991905197312659261 vs 4994735934893732502) (total_kvs: 7 vs 10) (total_bytes:287 vs 410)
tidb lightning encountered error: [Lighting:Restore:ErrChecksumMismatch]checksum mismatched remote vs local => (checksum: 17991905197312659261 vs 4994735934893732502) (total_kvs: 7 vs 10) (total_bytes:287 vs 410)
```
### 4. What is your TiDB version? (Required)
26df62fef2aaef130c4c3e821a5ba7f37c1eb4d1
Contributor guide
Assessment
This issue has not been assessed yet.