-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[lightning] Estimate rowid might overflow when import data and auto fill int column. #28776
Comments
@kennytm What do you think, seems do this check in precheck is not easy? Can we only check in |
given that we have max-error now i think we should turn the default SQL mode back to |
/assign buchuitoudegou |
/unassign glorv |
There are other issues when filling test:
result:
id didn't overflow. But we were expecting |
Possible root cause: After reading a row from the file, Similarly, when It's intuitive to add a check or re-estimate these values, but would it be better to have a global ID allocator managing these stuff for us? /cc @gozssky @niubell |
this issue affects 4.0/6.0, don't affects 5.x? |
It might affect all of them. |
This issue has a workaround: setting the auto-increment key as bigint or unsigned bigint can allow tidb to have a larger key space so that the auto-increment key won't exceed the limit. #34288 is not sophisticated enough so it was reverted temporarily. We will try to find out a better way to resolve it. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
This issue was created according to ONCALL-3504
Using lightning to import data, before lightning import, create the schema in TiDB manually and adding an extra column:
id_auto_incr
int(11) NOT NULL AUTO_INCREMENT, during import, lightning will estimate the rowid and auto fill this column (as this column doesn't exists in data source), and rowid might overflow in some cases and result in data inconsistency.2. What did you expect to see? (Required)
Lightning import should be successful and data consistency should be ensured.
3. What did you see instead (Required)
Lighting import failed with checksum mistch.
4. What is your TiDB version? (Required)
Lightning: 4.0.14
The text was updated successfully, but these errors were encountered: