br icon indicating copy to clipboard operation
br copied to clipboard

BR: restore sql compatible test data failed

Open cyliu0 opened this issue 3 years ago • 5 comments

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

br restore sql compatible test data

  1. What did you expect to see? Restore successfully

  2. What did you see instead?

$ ./bin/br restore db --db cluster_index -s "s3://tools-uw2/sql-compatible/br.backup?region=us-west-2" -u "172.31.2.59:2379" --log-file br.log
Detail BR log in br.log
Database restore <--------------------------------------------------------------------------------------------> 100.00%
Error: [parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 72 near "-9223372036854775808;"
  1. What version of BR and TiDB/TiKV/PD are you using?
$ ./bin/br -V
Release Version: v5.0.0-master
Git Commit Hash: fa66494bcf9395016b7847fecddd7e83478af27a
Git Branch: master
Go Version: go1.16.2
UTC Build Time: 2021-03-28 02:36:16
Race Enabled: false
mysql [email protected]:(none)> select * from information_schema.cluster_info
+------+---------------------+---------------------+---------------+------------------------------------------+----------------------+------------------+-----------+
| TYPE | INSTANCE            | STATUS_ADDRESS      | VERSION       | GIT_HASH                                 | START_TIME           | UPTIME           | SERVER_ID |
+------+---------------------+---------------------+---------------+------------------------------------------+----------------------+------------------+-----------+
| tidb | 172.31.21.226:4000  | 172.31.21.226:10080 | 5.0.0-nightly | 638272efb2aa3be419a0dd56cb546121a9b5ff7a | 2021-03-28T02:52:49Z | 42m23.064678337s | 0         |
| tidb | 172.31.19.4:4000    | 172.31.19.4:10080   | 5.0.0-nightly | 638272efb2aa3be419a0dd56cb546121a9b5ff7a | 2021-03-28T02:52:47Z | 42m25.064681702s | 0         |
| pd   | 172.31.11.157:2379  | 172.31.11.157:2379  | 5.0.0-rc.x    | 687acfc8db8378e01e47ab21dd38473a3ff8d800 | 2021-03-28T02:49:49Z | 45m23.064683418s | 0         |
| pd   | 172.31.3.29:2379    | 172.31.3.29:2379    | 5.0.0-rc.x    | 687acfc8db8378e01e47ab21dd38473a3ff8d800 | 2021-03-28T02:49:42Z | 45m30.064684586s | 0         |
| pd   | 172.31.2.59:2379    | 172.31.2.59:2379    | 5.0.0-rc.x    | 687acfc8db8378e01e47ab21dd38473a3ff8d800 | 2021-03-28T02:49:44Z | 45m28.064685734s | 0         |
| tikv | 172.31.16.17:20160  | 172.31.16.17:20180  | 5.0.0-rc.x    | 4db8ee36f69b3ec2d5c5281800e1161ee7af7665 | 2021-03-28T02:51:41Z | 43m31.064686901s | 0         |
| tikv | 172.31.17.242:20160 | 172.31.17.242:20180 | 5.0.0-rc.x    | 4db8ee36f69b3ec2d5c5281800e1161ee7af7665 | 2021-03-28T02:52:42Z | 42m30.064688201s | 0         |
| tikv | 172.31.18.97:20160  | 172.31.18.97:20180  | 5.0.0-rc.x    | 4db8ee36f69b3ec2d5c5281800e1161ee7af7665 | 2021-03-28T02:51:01Z | 44m11.064689581s | 0         |
+------+---------------------+---------------------+---------------+------------------------------------------+----------------------+------------------+-----------+
  1. Operation logs

    • Please upload br.log for BR if possible
    • Please upload tidb-lightning.log for TiDB-Lightning if possible
    • Please upload tikv-importer.log from TiKV-Importer if possible
    • Other interesting logs
  2. Configuration of the cluster and the task

    • tidb-lightning.toml for TiDB-Lightning if possible
    • tikv-importer.toml for TiKV-Importer if possible
    • topology.yml if deployed by TiUP
  3. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus if possible

cyliu0 avatar Mar 28 '21 03:03 cyliu0

Can you upload the br.log?

kennytm avatar Mar 28 '21 10:03 kennytm

According to @3pointer, it's a boundary issue that br restore cannot handle properly with an auto_random table runs out auto_random_base. BR overflows with this table. This particular table is from our SQL compatible test which is quite rare in customer scenarios.

cyliu0 avatar Mar 29 '21 03:03 cyliu0

Err so there is a minimal test case then?

kennytm avatar Mar 29 '21 06:03 kennytm

@kennytm One of the tables is like this

CREATE TABLE PK_AUTO_RANDOM9112 (COL1 BIGINT AUTO_RANDOM,COL2 VARCHAR(20),COL4 DATETIME,COL3 BIGINT,COL5 FLOAT,PRIMARY KEY(COL1)) ;
insert into PK_AUTO_RANDOM9112 (COL1,COL2,COL4,COL3,COL5) values(9223372036854775807,"褡蛗漜挰疔嗶降镑頫猔嬕兪袱哖節砭批酨焷詧","0892\-05\-21\ 19:03:19",-685882192225613411,-7.625264136427621e+37);

cyliu0 avatar Mar 31 '21 07:03 cyliu0

https://github.com/pingcap/br/pull/458 may fix it.

3pointer avatar Apr 02 '21 04:04 3pointer