From aae73d8a0befd6744ed63771805f5ac68dd353fd Mon Sep 17 00:00:00 2001 From: husharp Date: Thu, 17 Aug 2023 17:25:18 +0800 Subject: [PATCH] fix panic when failed to create pdclient Signed-off-by: husharp --- store/driver/tikv_driver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/driver/tikv_driver.go b/store/driver/tikv_driver.go index e3543eaba4b4b..cfd8bc553f48c 100644 --- a/store/driver/tikv_driver.go +++ b/store/driver/tikv_driver.go @@ -156,11 +156,11 @@ func (d TiKVDriver) OpenWithOptions(path string, options ...Option) (resStore kv ), pd.WithCustomTimeoutOption(time.Duration(d.pdConfig.PDServerTimeout)*time.Second), pd.WithForwardingOption(config.GetGlobalConfig().EnableForwarding)) - pdCli = util.InterceptedPDClient{Client: pdCli} if err != nil { return nil, errors.Trace(err) } + pdCli = util.InterceptedPDClient{Client: pdCli} // FIXME: uuid will be a very long and ugly string, simplify it. uuid := fmt.Sprintf("tikv-%v", pdCli.GetClusterID(context.TODO()))