Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

lightning v5.1.0 load clustered index schema to TiDB 4.0.14 failed #1362

Closed
Tammyxia opened this issue Jul 19, 2021 · 0 comments · Fixed by #1364
Closed

lightning v5.1.0 load clustered index schema to TiDB 4.0.14 failed #1362

Tammyxia opened this issue Jul 19, 2021 · 0 comments · Fixed by #1364

Comments

@Tammyxia
Copy link

Tammyxia commented Jul 19, 2021

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
  • tiup tidb-lightning --config lightning.toml
    Starting component tidb-lightning: /root/.tiup/components/tidb-lightning/v5.1.0/tidb-lightning --config lightning.toml

  • lightning.toml:
    [lightning]
    level = "info"
    file = "tidb-lightning.log"
    #check-requirements = false

[tikv-importer]
backend = "local"
sorted-kv-dir = "/data1/tammy/lightning"

[mydumper]
data-source-dir = "s3://nfs//Tools-workload/CDC/sysbench-1100g-50table?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true"

[tidb]
host = "172.16.xxx"
port = 4000
user = "root"
password = ""
status-port = 10080
pd-addr = "172.16.6xxx"

  1. What did you expect to see?
    Successful to load data.

  2. What did you see instead?

  • Failed to load clustered index schema to TiDB 4.0.14,
    tidb lightning encountered error: restore table schema new0519.sbtest22 failed: Error 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 239 near "CLUSTERED,INDEX k_22(k)) ENGINE = InnoDB DEFAULT CHARACTER SET = UTF8MB4 DEFAULT COLLATE = UTF8MB4_BIN AUTO_INCREMENT = 123366227;"

  • ./mc cat qa-minio/nfs/Tools-workload/CDC/sysbench-1100g-50table/new0519.sbtest22-schema.sql
    /!40101 SET NAMES binary/;
    CREATE TABLE sbtest22 (
    id int(11) NOT NULL AUTO_INCREMENT,
    k int(11) NOT NULL DEFAULT '0',
    c char(120) NOT NULL DEFAULT '',
    pad char(60) NOT NULL DEFAULT '',
    PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */,
    KEY k_22 (k)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=123366227;

  • The failed DDL can be executed in TiDB v4.0.14 directly:
    MySQL [new0519]> CREATE TABLE sbtest22 (
    -> id int(11) NOT NULL AUTO_INCREMENT,
    -> k int(11) NOT NULL DEFAULT '0',
    -> c char(120) NOT NULL DEFAULT '',
    -> pad char(60) NOT NULL DEFAULT '',
    -> PRIMARY KEY (id) /*T![clustered_index] CLUSTERED */,
    -> KEY k_22 (k)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=123366227;
    Query OK, 0 rows affected (3.02 sec)

MySQL [new0519]> show tables;
+-------------------+
| Tables_in_new0519 |
+-------------------+
| sbtest22 |
+-------------------+
1 row in set (0.00 sec)
MySQL [new0519]> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.14
Edition: Community
Git Commit Hash: a3baab49f93ba33915fd7ab6b19d8bc12e6542ce
Git Branch: heads/refs/tags/v4.0.14
UTC Build Time: 2021-07-15 06:54:45
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

  1. What version of BR and TiDB/TiKV/PD are you using?
  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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants