tikv / tikv

Distributed transactional key-value database, originally created to complement TiDB
https://tikv.org
Apache License 2.0
15.02k stars 2.12k forks source link

[Dynamic Regions] AVAILABLE is always 0 when query information_schema.tiflash_replica after br restore tiflash data with 2 replicas #15724

Closed Lily2025 closed 11 months ago

Lily2025 commented 11 months ago

Bug Report

What version of TiKV are you using?

./tikv-server -V TiKV Release Version: 7.5.0-alpha Edition: Community Git Commit Hash: fda1b5caf19f3ee87ab26c4458c64a6b3f3ea5ca Git Commit Branch: heads/refs/tags/v7.5.0-alpha UTC Build Time: 2023-09-28 11:48:46 Rust Version: rustc 1.67.0-nightly (96ddd32c4 2022-11-14) Enable Features: pprof-fp jemalloc mem-profiling portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure Profile: dist_release

What operating system and CPU are you using?

8c/32g

Steps to reproduce

1、/br restore db --send-credentials-to-tikv=true --db tpcc --pd http://tc-pd.endless-ha-test-htap-tps-2880160-1-720:2379 --storage s3://nfs/tiflash/ch-2k-flash2-collation --s3.endpoint http://minio.pingcap.net:9000 --check-requirements=false 2、select * from information_schema.tiflash_replica [{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2759\",\"TABLE_NAME\":\"supplier\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2725\",\"TABLE_NAME\":\"warehouse\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2735\",\"TABLE_NAME\":\"orders\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2727\",\"TABLE_NAME\":\"district\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2737\",\"TABLE_NAME\":\"order_line\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2729\",\"TABLE_NAME\":\"customer\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2731\",\"TABLE_NAME\":\"history\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2755\",\"TABLE_NAME\":\"nation\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2739\",\"TABLE_NAME\":\"stock\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2741\",\"TABLE_NAME\":\"item\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2733\",\"TABLE_NAME\":\"new_order\",\"TABLE_SCHEMA\":\"tpcc\"},{\"AVAILABLE\":\"0\",\"LOCATION_LABELS\":\"\",\"PROGRESS\":\"0\",\"REPLICA_COUNT\":\"2\",\"TABLE_ID\":\"2757\",\"TABLE_NAME\":\"region\",\"TABLE_SCHEMA\":\"tpcc\"}]"]

What did you expect?

AVAILABLE is 1 after br restore tiflash data with 2 replicas

What did happened?

AVAILABLE is always 0 when query information_schema.tiflash_replica after br restore tiflash data with 2 replicas

Lily2025 commented 11 months ago

should record in tiflash repo