Skip to content

tidb panic with error “[ERROR] [client_batch.go:337] [batchSendLoop] [r="runtime error: slice bounds out of range [-1:]"]” #51921

@Lily2025

Description

@Lily2025

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/[email protected]/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/[email protected]/pkg/tikvpb/tikvpb.pb.go:4478\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*BatchCommandsRequest).MarshalToSizedBuffer\n\t/go/pkg/mod/github.com/pingcap/[email protected]/pkg/tikvpb/tikvpb.pb.go:4436\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*BatchCommandsRequest).Marshal\n\t/go/pkg/mod/github.com/pingcap/[email protected]/pkg/tikvpb/tikvpb.pb.go:4394\ngoogle.golang.org/protobuf/internal/impl.legacyMarshal\n\t/go/pkg/mod/google.golang.org/[email protected]/internal/impl/legacy_message.go:407\ngoogle.golang.org/protobuf/proto.MarshalOptions.marshal\n\t/go/pkg/mod/google.golang.org/[email protected]/proto/encode.go:166\ngoogle.golang.org/protobuf/proto.Marshal\n\t/go/pkg/mod/google.golang.org/[email protected]/proto/encode.go:80\ngoogle.golang.org/grpc/encoding/proto.codec.Marshal\n\t/go/pkg/mod/google.golang.org/[email protected]/encoding/proto/proto.go:47\ngoogle.golang.org/grpc.encode\n\t/go/pkg/mod/google.golang.org/[email protected]/rpc_util.go:647\ngoogle.golang.org/grpc.prepareMsg\n\t/go/pkg/mod/google.golang.org/[email protected]/stream.go:1771\ngoogle.golang.org/grpc.(*clientStream).SendMsg\n\t/go/pkg/mod/google.golang.org/[email protected]/stream.go:893\ngithub.com/pingcap/kvproto/pkg/tikvpb.(*tikvBatchCommandsClient).Send\n\t/go/pkg/mod/github.com/pingcap/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions