tidb panic with error “[ERROR] [client_batch.go:337] [batchSendLoop] [r="runtime error: slice bounds out of range [-1:]"]” #51921
Labels
affects-7.1
affects-7.5
affects-8.0
severity/major
sig/transaction
SIG:Transaction
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
1、run mussel workload
2、inject network partition between pd leader and pd followers
2. What did you expect to see? (Required)
no panic
3. What did you see instead (Required)
tidb panic
logs:
tidb-0.tar.gz
[2024/03/20 03:29:52.792 +08:00] [ERROR] [client_batch.go:337] [batchSendLoop] [r="runtime error: slice bounds out of range [-1:]"] [stack="github.com/tikv/client-go/v2/internal/client.(*batchConn).batchSendLoop.func1\n\t/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240316105842-98a7df8f413d/internal/client/client_batch.go:339\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:914\nruntime.goPanicSliceB\n\t/usr/local/go/src/runtime/panic.go:154\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*BatchCommandsRequest_Request).MarshalToSizedBuffer\n\t/go/pkg/mod/github.com/pingcap/kvproto@v0.0.0-20240227073058-929ab83f9754/pkg/tikvpb/tikvpb.pb.go:4478\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*BatchCommandsRequest).MarshalToSizedBuffer\n\t/go/pkg/mod/github.com/pingcap/kvproto@v0.0.0-20240227073058-929ab83f9754/pkg/tikvpb/tikvpb.pb.go:4436\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*BatchCommandsRequest).Marshal\n\t/go/pkg/mod/github.com/pingcap/kvproto@v0.0.0-20240227073058-929ab83f9754/pkg/tikvpb/tikvpb.pb.go:4394\ngoogle.golang.org/protobuf/internal/impl.legacyMarshal\n\t/go/pkg/mod/google.golang.org/protobuf@v1.33.0/internal/impl/legacy_message.go:407\ngoogle.golang.org/protobuf/proto.MarshalOptions.marshal\n\t/go/pkg/mod/google.golang.org/protobuf@v1.33.0/proto/encode.go:166\ngoogle.golang.org/protobuf/proto.Marshal\n\t/go/pkg/mod/google.golang.org/protobuf@v1.33.0/proto/encode.go:80\ngoogle.golang.org/grpc/encoding/proto.codec.Marshal\n\t/go/pkg/mod/google.golang.org/grpc@v1.62.1/encoding/proto/proto.go:47\ngoogle.golang.org/grpc.encode\n\t/go/pkg/mod/google.golang.org/grpc@v1.62.1/rpc_util.go:647\ngoogle.golang.org/grpc.prepareMsg\n\t/go/pkg/mod/google.golang.org/grpc@v1.62.1/stream.go:1771\ngoogle.golang.org/grpc.(*clientStream).SendMsg\n\t/go/pkg/mod/google.golang.org/grpc@v1.62.1/stream.go:893\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*tikvBatchCommandsClient).Send\n\t/go/pkg/mod/github.com/pingcap/kvproto@v0.0.0-20240227073058-929ab83f9754/pkg/tikvpb/tikvpb.pb.go:2293\ngithub.com/tikv/client-go/v2/internal/client.(*batchCommandsClient).send\n\t/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240316105842-98a7df8f413d/internal/client/client_batch.go:599\ngithub.com/tikv/client-go/v2/internal/client.(*batchConn).getClientAndSend\n\t/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240316105842-98a7df8f413d/internal/client/client_batch.go:435\ngithub.com/tikv/client-go/v2/internal/client.(*batchConn).batchSendLoop\n\t/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.8-0.20240316105842-98a7df8f413d/internal/client/client_batch.go:378"]
[2024/03/20 03:29:52.792 +08:00] [INFO] [client_batch.go:341] ["restart batchSendLoop"] [count=2]
4. What is your TiDB version? (Required)
./tidb-server -V
Release Version: v8.0.0-alpha
Edition: Community
Git Commit Hash: 02be83a
Git Branch: heads/refs/tags/v8.0.0-alpha
UTC Build Time: 2024-03-17 12:14:34
GoVersion: go1.21.6
Race Enabled: false
Check Table Before Drop: false
Store: unistore
2024-03-20T03:14:17.205+0800
The text was updated successfully, but these errors were encountered: