PD:tso:ErrGenerateTimestamp errors should not appear on the application side
When upgrading a TiDB cluster, PD changes the leader. PD:tso:ErrGenerateTimestamp error will appear on application side.In fact, the PD leader switchover only took 1-2 s. Retries should be added to reduce the probability of this error occurring on application side.
[2023/08/10 04:03:48.262 +00:00] [ERROR] [client.go:857] ["[pd] getTS error"] [dc-location=global] [stream-addr=https://db-pd-2.db-pd-peer.tidbxxxxxxx.svc:2379] [error="[PD:client:ErrClientGetTSO]rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster: rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]