pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.41k stars 5.85k forks source link

Should not enable port before tidb starts successfully #34233

Open qqqdan opened 2 years ago

qqqdan commented 2 years ago

Enhancement

Issue source: https://asktug.com/t/topic/663316 For the issue mentioned in the above topic, the user used tiup to start the tidb cluster. TiUP kept trying the port 4000 after the "start" commend, and TiUP would show "Started cluster liking successfully" when the port is accessible. In the above case,actually the cluster failed to start ,but it enabled the port (4000) . TiUP can access the port, then it showed "Started cluster successfully" which was misleading .

Expected behavior: Tidb should not make the port accessible before it really start successfully.

Defined2014 commented 2 years ago

For this case, TiDB could change the listening tcp socket after create domain socket, but it can't fix all such problems.

IMO, TiUP should use tcp packets to detect if TiDB is available, it will be more accurate.