Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Lightning does not work with table with tiflash replica #273

Closed
JaySon-Huang opened this issue Feb 27, 2020 · 2 comments
Closed

Lightning does not work with table with tiflash replica #273

JaySon-Huang opened this issue Feb 27, 2020 · 2 comments
Assignees
Labels
type/bug This issue is a bug report

Comments

@JaySon-Huang
Copy link

JaySon-Huang commented Feb 27, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
# First setup a cluster with tiflash
# Create table and data in tidb and add tiflash replica
mysql> CREATE DATABASE IF NOT EXISTS `test`;
mysql> CREATE TABLE `test`.`t` (`Year` year(4) DEFAULT 0 NOT NULL) DEFAULT CHARSET=utf8mb4;
mysql> ALTER TABLE t set tiflash replica 1;
mysql> select * from information_schema.tiflash_replica; # Use this to check tiflash replica status
# Create a file with some rows
# Load data with tidb-lightning
  1. What did you expect to see?
    In TiFlash v3.1, we don't support IngestSST command. Hope that tidb-lightning can check if target table has tiflash replica, if have, give an error to tell user we don't support it for now.

  2. What did you see instead?
    lightning will exit with errors and data do NOT loaded.

[2020/02/27 13:20:45.637 +08:00] [INFO] [restore.go:473] [progress] [files="1/1 (100.0%)"] [tables="0/1 (0.0%)"] [speed(MiB/s)=0.00000007947365515542592] [state=post-processing] []
[2020/02/27 13:20:52.188 +08:00] [WARN] [backend.go:286] ["import spuriously failed, going to retry again"] [engineTag=`test`.`t`:0] [engineUUID=c32475d3-88af-5442-b950-a0e82e40d337] [retryCnt=2] [error="rpc error: code = Unknown desc = ImportJobFailed(\"retry 5 times still 1 ranges failed\")"]
[2020/02/27 13:20:55.188 +08:00] [ERROR] [restore.go:1404] ["import and cleanup engine failed"] [engineTag=`test`.`t`:0] [engineUUID=c32475d3-88af-5442-b950-a0e82e40d337] [takeTime=3m9.505358837s] [error="[c32475d3-88af-5442-b950-a0e82e40d337] import reach max retry 3 and still failed: rpc error: code = Unknown desc = ImportJobFailed(\"retry 5 times still 1 ranges failed\")"]
[2020/02/27 13:20:55.188 +08:00] [ERROR] [restore.go:795] ["import whole table failed"] [table=`test`.`t`] [takeTime=3m9.526326415s] [error="[c32475d3-88af-5442-b950-a0e82e40d337] import reach max retry 3 and still failed: rpc error: code = Unknown desc = ImportJobFailed(\"retry 5 times still 1 ranges failed\")"]
  1. Versions of the cluster

    • TiDB-Lightning version (run tidb-lightning -V):

      ./importer/tidb-lightning -V 
      Release Version: v3.0.5-2-g605760d
      Git Commit Hash: 605760d1b2025d1e1a8b7d0c668c74863d7d1271
      Git Branch: master
      UTC Build Time: 2019-12-04 07:23:09
      Go Version: go version go1.13.1 linux/amd64
      
    • TiKV-Importer version (run tikv-importer -V)

      ./importer/tikv-importer -V
      TiKV Importer 4.0.0-alpha
      
    • TiKV version (run tikv-server -V):

      Release Version:   3.1.0-beta.1
      Git Commit Hash:   d1f9d486aa8e4ab29652e80a32c6d152db653dec
      Git Commit Branch: release-3.1
      UTC Build Time:    2020-02-19 03:39:48
      
    • TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

      Release Version: v3.1.0-beta.1-5-gf90a7892d
      Git Commit Hash: f90a7892d2d69974f17f01fc189937bb1e04c4f1
      Git Branch: release-3.1
      UTC Build Time: 2020-02-24 03:08:18
      
    • Other interesting information (system version, hardware config, etc):

  2. Operation logs

    • 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
    • inventory.ini if deployed by Ansible
  4. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for TiDB-Lightning if possible

@JaySon-Huang JaySon-Huang added the type/bug This issue is a bug report label Feb 27, 2020
@JaySon-Huang
Copy link
Author

Maybe this is helpful for you

You can use this to check if table have tiflash replica status in tidb

mysql> select * from information_schema.tiflash_replica; 

TiFlash store will have "engine"="tiflash" in store's label

{
      "store": {
        "id": 44,
        "address": "xxx:xx",
        "labels": [
          {
            "key": "tiflash_http_port",
            "value": "xxx"
          },
          {
            "key": "engine",
            "value": "tiflash"
          }
        ],
        "version": "3.1.0-beta",
        "peer_address": "xxx:xxx",
        "state_name": "Up"
      },
      "status": {
        ...
      }
    }

@solotzg
Copy link
Contributor

solotzg commented Mar 20, 2020

Latest tiflash has supported tidb-lighting, close it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug This issue is a bug report
Projects
None yet
Development

No branches or pull requests

2 participants