Skip to content
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 max-error record tripled when backend is tidb #29996

Closed
fubinzh opened this issue Nov 22, 2021 · 1 comment · Fixed by #30179
Closed

lightning max-error record tripled when backend is tidb #29996

fubinzh opened this issue Nov 22, 2021 · 1 comment · Fixed by #30179
Assignees
Labels
component/lightning This issue is related to Lightning of TiDB. found/automation Found by automation tests severity/moderate type/bug The issue is confirmed as a bug.

Comments

@fubinzh
Copy link

fubinzh commented Nov 22, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Do lightning import for data with 2 type errors (e.g. type error), and check max-error records in lightning_task_info.type_error_v1

Test data:

[root@centos76_vm type_error]# tail max_error.t2.1.csv
21348226,"lGztBz","2021-11-17 00:00:00"
89250625,"ltDGh","2021-11-17 00:00:00"
9207504,"iEMNwuP","2021-11-17 00:00:00"
1,"b1","2021-11-14 00:00:00"
2,"b2","2021-11-14 00:00:00"
3,"b3","2021-11-14 00:00:00"
4,"b4","2021-11-14 00:00:00"
"xxx","b5","2021-11-15 00:00:00"
5,"b6","0"

[root@centos76_vm type_error]# cat max_error.t2-schema.sql
/*!40101 SET NAMES binary*/;
CREATE TABLE `t2` (
  `a` int(11) NOT NULL,
  `b` varchar(10) DEFAULT NULL,
  `c` datetime DEFAULT NULL,
  PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */,
  UNIQUE KEY `uk_b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

lightning config is as below

[root@centos76_vm type_error]# grep -v ^# lightning.toml
[lightning]
level = "info"
file = "tidb-lightning.log"
max-error = 10

[checkpoint]
driver = "mysql"

[tikv-importer]
backend = "tidb"
sorted-kv-dir = "/home/sorted-kv-dir"

[mydumper]
data-source-dir = "s3://nfs/tools_test_data/max_error/type_error?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true"
no-schema = false

filter = ['*.*', 'mysql.*', '!sys.*', '!INFORMATION_SCHEMA.*', '!PERFORMANCE_SCHEMA.*', '!METRICS_SCHEMA.*', '!INSPECTION_SCHEMA.*']

[mydumper.csv]
separator = ','
delimiter = '"'
header = true


[tidb]
host = "172.16.6.217"
port = 4000
user = "root"
status-port = 10080
sql-mode = "STRICT_TRANS_TABLES"

2. What did you expect to see? (Required)

lightning_task_info.type_error_v1 should record 2 rows with type error

3. What did you see instead (Required)

lightning_task_info.type_error_v1 recorded 6 rows with type error, the records are tripled.
This issue is NOT seem when backend is local.

mysql> select * from lightning_task_info.type_error_v1;
+---------------------+----------------------------+------------------+--------------------+--------+-------------------------------------------------------------------+------------------------------------+
| task_id             | create_time                | table_name       | path               | offset | error                                                             | row_data                           |
+---------------------+----------------------------+------------------+--------------------+--------+-------------------------------------------------------------------+------------------------------------+
| 1637567621075919308 | 2021-11-22 15:53:42.370553 | `max_error`.`t2` | max_error.t2.1.csv |   3803 | Error 1366: Incorrect int value: 'xxx' for column 'a' at row 1    | ('xxx','b5','2021-11-15 00:00:00') |
| 1637567621075919308 | 2021-11-22 15:53:42.379626 | `max_error`.`t2` | max_error.t2.1.csv |   3836 | Error 1292: Incorrect datetime value: '0' for column 'c' at row 1 | ('5','b6','0')                     |
| 1637567621075919308 | 2021-11-22 15:53:42.507533 | `max_error`.`t2` | max_error.t2.1.csv |   3803 | Error 1366: Incorrect int value: 'xxx' for column 'a' at row 1    | ('xxx','b5','2021-11-15 00:00:00') |
| 1637567621075919308 | 2021-11-22 15:53:42.512061 | `max_error`.`t2` | max_error.t2.1.csv |   3836 | Error 1292: Incorrect datetime value: '0' for column 'c' at row 1 | ('5','b6','0')                     |
| 1637567621075919308 | 2021-11-22 15:53:42.640734 | `max_error`.`t2` | max_error.t2.1.csv |   3803 | Error 1366: Incorrect int value: 'xxx' for column 'a' at row 1    | ('xxx','b5','2021-11-15 00:00:00') |
| 1637567621075919308 | 2021-11-22 15:53:42.645454 | `max_error`.`t2` | max_error.t2.1.csv |   3836 | Error 1292: Incorrect datetime value: '0' for column 'c' at row 1 | ('5','b6','0')                     |
+---------------------+----------------------------+------------------+--------------------+--------+-------------------------------------------------------------------+------------------------------------+
6 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

[root@centos76_vm type_error]# tiup tidb-lightning:v5.3.0 -V
Starting component tidb-lightning: /root/.tiup/components/tidb-lightning/v5.3.0/tidb-lightning -V
Release Version: v5.3.0
Git Commit Hash: 79e237d
Git Branch: heads/refs/tags/v5.3.0
Go Version: go1.16.4
UTC Build Time: 2021-11-18 13:06:05
Race Enabled: false

@fubinzh fubinzh added type/bug The issue is confirmed as a bug. severity/moderate component/lightning This issue is related to Lightning of TiDB. found/automation Found by automation tests labels Nov 22, 2021
@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. found/automation Found by automation tests severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants