client: refine some client code (#4205)
client: refine some client code (#4205)

* Refine some client code

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* ref #3149

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <040e6455cde1c91e876ec337e785ce913eacba35@tidb.io>
pingcap/pd,pingcap/pd