pingcap / tidb-docker-compose

Apache License 2.0
351 stars 155 forks source link

TiKV servers are not assigned regions #82

Open noirgif opened 4 years ago

noirgif commented 4 years ago

I'm using Archlinux, 5.4.1 kernel. Docker version Docker version 19.03.5-ce, build 633a0ea838.

Steps to reproduce:

  1. Follow the instructions for docker-compose, but use network=host, and comment everything out except TiKV and PD sections.
  2. call pd-ctl region It showed only one peer in the region, other two are missing.

Calling pd-ctl region store <id> on the stores attests to the results(only one of the store has a region).

Calling pd-ctl store show will return all the stores, so I assume all TiKVs are connected to PDs.

Caling pd-ctl member showed that all PDs are connected.

This can be reproduced with the docker swarm as well. I created a container with pd-ctl in it to access nodes in the overlay network, and the results are the same as above.

noirgif commented 4 years ago

pd-ctl region output pd-ctl store show output TiKV logs for start, key insertion, and shutdown PD logs

tennix commented 4 years ago

@noirgif Thank you for reporting this. Here are what I can get from your context:

@nolouch Could you take a look at this issue?

nolouch commented 4 years ago

Hi, @noirgif . according to the log:

[2019/12/06 19:55:09.678 +00:00] [DEBUG] [replica_checker.go:80] ["region has fewer than max replicas"] [region-id=4] [peers=1]
[2019/12/06 19:55:09.680 +00:00] [DEBUG] [replica_checker.go:122] ["no best store to add replica"] [region-id=4]
[2019/12/06 19:55:09.779 +00:00] [DEBUG] [replica_checker.go:80] ["region has fewer than max replicas"] [region-id=4] [peers=1]
[2019/12/06 19:55:09.779 +00:00] [DEBUG] [replica_checker.go:122] ["no best store to add replica"] [region-id=4]

The problem is that the available capacity : 13G is too low to compare to capacity:108 G. you can change the tikv config:

[raftstore]
capacity = "10GB"