pingcap / tidb

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

kvclient panic when kill pd leader during br backup #54848

Open crazycs520 opened 3 months ago

crazycs520 commented 3 months ago

Bug Report

Related Issue: https://github.com/tikv/client-go/issues/1357

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

1、run br backup 2、kill pd leader 3、br backup failed `panic: close of closed channel

goroutine 2822 [running]: github.com/tikv/client-go/v2/internal/client.(*batchConn).Close(...) /root/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240528025037-f41b068bf706/internal/client/client_batch.go:769 github.com/tikv/client-go/v2/internal/client.(*connArray).Close(0xc0004bb560) /root/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240528025037-f41b068bf706/internal/client/client.go:330 +0xf6 github.com/tikv/client-go/v2/internal/client.(*RPCClient).CloseAddr(0xc0007e3680, {0xc000f7e7d0, 0x44}) /root/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240528025037-f41b068bf706/internal/client/client.go:797 +0x1e5 github.com/tikv/client-go/v2/internal/client.(*RPCClient).recycleIdleConnArray(0xc0007e3680) /root/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240528025037-f41b068bf706/internal/client/client_batch.go:835 +0x1f7 created by github.com/tikv/client-go/v2/internal/client.(*RPCClient).sendRequest in goroutine 2821 /root/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240528025037-f41b068bf706/internal/client/client.go:587 +0x34b`

tidb version: ./tidb-server -V Release Version: v7.5.2 Edition: Community Git Commit Hash: 39ea2b30d32ab8cf486f30ca318cf2e4bd99eaef Git Branch: HEAD UTC Build Time: 2024-05-29 15:07:12 GoVersion: go1.21.10 Race Enabled: false Check Table Before Drop: false Store: unistore 2024-05-30T14:14:32.686+0800

cfzjywxk commented 1 day ago

@crazycs520 Please verify if it is resolved in release-8.5 branch

crazycs520 commented 1 day ago

This issue doesn't affect release-8.5, since release-8.5 already contain the fix.