tiup
tiup copied to clipboard
Redundant log "Waiting for tidb instances ready"
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
Run
tiup playground
-
What did you expect to see? one line of "Waiting for tidb instances ready" log
-
What did you see instead? multi line of "Waiting for tidb instances ready" log
-
What version of TiUP are you using (
tiup --version
)?
v1.3.0 tiup
Go Version: go1.13
Git Branch: release-1.3
GitHash: edb12b8
Actually, it's not a bug, it's a progress status bar, and will stop print out until TiDB is fully started, see more from here: https://github.com/pingcap/tiup/blob/edb12b8621fc4ac06154fd114fe0f46f0c0464e7/components/playground/playground.go#L792-L820
I think that if only one tidb instance is started, only one line of log should be output, because the tiflash below it does this, but I see this:
Starting component `playground`: /home/danght/.tiup/components/playground/v1.3.0/tiup-playground
Use the latest stable version: v4.0.8
Specify version manually: tiup playground <version>
The stable version: tiup playground v4.0.0
The nightly version: tiup playground nightly
Playground Bootstrapping...
Start pd instance
Start tikv instance
Start tidb instance
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
127.0.0.1:4000 ... Done
Start tiflash instance
Waiting for tiflash instances ready
127.0.0.1:3930 ... Done
CLUSTER START SUCCESSFULLY, Enjoy it ^-^
To connect TiDB: mysql --host 127.0.0.1 --port 4000 -u root
To view the dashboard: http://127.0.0.1:2379/dashboard
To view the Prometheus: http://127.0.0.1:9090
To view the Grafana: http://127.0.0.1:3000
First of all, the Waiting for
message is based on the starting-time, not on the number of instances, and the default render time is 50ms
:
https://github.com/pingcap/tiup/blob/edb12b8621fc4ac06154fd114fe0f46f0c0464e7/pkg/cliutil/progress/progress.go#L34
and you can increase this value to see if the output decreased or not by set env TIUP_CLUSTER_PROGRESS_REFRESH_RATE
to have a try
https://github.com/pingcap/tiup/blob/edb12b8621fc4ac06154fd114fe0f46f0c0464e7/pkg/cliutil/progress/progress.go#L42
But that leaves me with the question, why has TiDB taken so long to bootup?
I tried to set env TIUP_CLUSTER_PROGRESS_REFRESH_RATE
to 500ms
and the output Waiting for tidb instances ready
did decrease, but the interesting thing is that the output Waiting for tiflash instances ready
increased. In the case of default 50ms
, it always has only one.:joy:
Also, my test environment is WSL Ubuntu 20.04 LTS.
$ tiup playground
Starting component `playground`: /home/danght/.tiup/components/playground/v1.3.0/tiup-playground
Use the latest stable version: v4.0.8
Specify version manually: tiup playground <version>
The stable version: tiup playground v4.0.0
The nightly version: tiup playground nightly
Playground Bootstrapping...
Start pd instance
Start tikv instance
Start tidb instance
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
Waiting for tidb instances ready
127.0.0.1:4000 ... Done
Start tiflash instance
Waiting for tiflash instances ready
Waiting for tiflash instances ready
Waiting for tiflash instances ready
Waiting for tiflash instances ready
Waiting for tiflash instances ready
127.0.0.1:3930 ... Done
CLUSTER START SUCCESSFULLY, Enjoy it ^-^
To connect TiDB: mysql --host 127.0.0.1 --port 4000 -u root
To view the dashboard: http://127.0.0.1:2379/dashboard
To view the Prometheus: http://127.0.0.1:9090
To view the Grafana: http://127.0.0.1:3000
I think it would be better if we change those lines to a progress bar status that always refresh itself on the same line, as suggested in #1454
Any update on this? It's really painful..