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

[lightning] admin check failed after importing table with expression index using local backend #1404

Closed
fubinzh opened this issue Aug 3, 2021 · 3 comments · Fixed by #1407

Comments

@fubinzh
Copy link

fubinzh commented Aug 3, 2021

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
  • Create table t3 with expression index

      CREATE TABLE `t3` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `a` varchar(20) DEFAULT NULL,
        `b` varchar(20) DEFAULT NULL,
        PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
        KEY `idx_a` (`a`),
        KEY `idx_lower_b` ((lower(`b`)))
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=90003;
  • Use dumpling to export the table

  • rename table t3 to t3bak

  • Use lightning local backend to import the table to TiDB

  1. What did you expect to see?
    Lightning import should be successful, and admin check for the table should pass after that.

  2. What did you see instead?
    Lightning import is successful, however admin check failed.

MySQL [test]> admin check table t3;
ERROR 8134 (HY000): col _V$_idx_lower_b_0, handle 1, index:types.Datum{k:0x5, decimal:0x0, length:0x0, i:0, collation:"utf8mb4_bin", b:[]uint8{0x1}, x:interface {}(nil)} != record:types.Datum{k:0x5, decimal:0x0, length:0x0, i:0, collation:"utf8mb4_bin", b:[]uint8{0x62, 0x62, 0x62}, x:interface {}(nil)}, compare err:<nil>

MySQL [test]> admin check index t3 idx_lower_b;
ERROR 8134 (HY000): col _V$_idx_lower_b_0, handle 1, index:types.Datum{k:0x5, decimal:0x0, length:0x0, i:0, collation:"utf8mb4_bin", b:[]uint8{0x1}, x:interface {}(nil)} != record:types.Datum{k:0x5, decimal:0x0, length:0x0, i:0, collation:"utf8mb4_bin", b:[]uint8{0x62, 0x62, 0x62}, x:interface {}(nil)}, compare err:<nil>

MySQL [test]> admin check table t3bak;
Query OK, 0 rows affected (0.01 sec)
  1. What version of BR and TiDB/TiKV/PD are you using?
    dumpling - v5.1.1
    tidb-lightning -V5.1.1
    tidb-server -V5.1.1
    tikv-server -V5.1.1

  2. 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
  3. 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
  4. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus if possible

@fubinzh
Copy link
Author

fubinzh commented Aug 3, 2021

Data in the table:
MySQL [test]> select * from t3;
+----+------+--------+
| id | a | b |
+----+------+--------+
| 1 | aaa | bbb |
| 2 | abc | cdsfds |
+----+------+--------+

@fubinzh
Copy link
Author

fubinzh commented Aug 3, 2021

Note: admin check is ok if lightning tidb backend is used.

@IANTHEREAL
Copy link
Collaborator

If there is a problem with sql2kv, the lightning checksum may not be able to detect it. If the user does not perform more data verification, the problem can only be found when the business goes wrong. We need to solve this problem

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.

2 participants