From 083897b41a48e3432fdb124a175757923e6eefe0 Mon Sep 17 00:00:00 2001
From: fagongzi <zhangxu19830126@gmail.com>
Date: Mon, 29 Aug 2022 11:46:06 +0800
Subject: [PATCH] dnservice: add retry txn request at dn node (#4746)

In some cases, TxnRequest is supported to retry on the DN to resolve DNShardNotFound errors due to inconsistent message propagation

Approved by: @reusee
---
 pkg/dnservice/store_rpc_handler.go      |  58 ++-
 pkg/dnservice/store_rpc_handler_test.go |  31 ++
 pkg/pb/txn/txn.pb.go                    | 524 +++++++++++++++++++-----
 proto/txn.proto                         |  11 +
 4 files changed, 529 insertions(+), 95 deletions(-)

diff --git a/pkg/dnservice/store_rpc_handler.go b/pkg/dnservice/store_rpc_handler.go
index 46d626451..bb294eb8e 100644
--- a/pkg/dnservice/store_rpc_handler.go
+++ b/pkg/dnservice/store_rpc_handler.go
@@ -17,12 +17,17 @@ package dnservice
 import (
 	"context"
 	"fmt"
+	"time"
 
 	"github.com/matrixorigin/matrixone/pkg/pb/metadata"
 	"github.com/matrixorigin/matrixone/pkg/pb/txn"
 	"github.com/matrixorigin/matrixone/pkg/txn/rpc"
 )
 
+const (
+	defaultRetryInterval = time.Millisecond * 100
+)
+
 func (s *store) registerRPCHandlers() {
 	// request from CN node
 	s.server.RegisterMethodHandler(txn.TxnMethod_Read, s.handleRead)
@@ -47,16 +52,25 @@ func (s *store) dispatchLocalRequest(shard metadata.DNShard) rpc.TxnRequestHandl
 }
 
 func (s *store) handleRead(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) error {
+	return s.handleWithRetry(ctx, request, response, s.doRead)
+}
+
+func (s *store) handleWrite(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) error {
+	return s.handleWithRetry(ctx, request, response, s.doWrite)
+}
+
+func (s *store) doRead(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) error {
 	r := s.validDNShard(request, response)
 	if r == nil {
 		return nil
 	}
 	r.waitStarted()
+
 	prepareResponse(request, response)
 	return r.service.Read(ctx, request, response)
 }
 
-func (s *store) handleWrite(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) error {
+func (s *store) doWrite(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) error {
 	r := s.validDNShard(request, response)
 	if r == nil {
 		return nil
@@ -148,3 +162,45 @@ func prepareResponse(request *txn.TxnRequest, response *txn.TxnResponse) {
 	response.Flag = request.Flag
 	response.RequestID = request.RequestID
 }
+
+func (s *store) handleWithRetry(ctx context.Context,
+	request *txn.TxnRequest,
+	response *txn.TxnResponse,
+	delegate rpc.TxnRequestHandleFunc) error {
+	for {
+		response.Reset()
+		err := delegate(ctx, request, response)
+		if err != nil {
+			return err
+		}
+
+		if !s.maybeRetry(ctx, request, response) {
+			return nil
+		}
+	}
+}
+
+func (s *store) maybeRetry(ctx context.Context, request *txn.TxnRequest, response *txn.TxnResponse) bool {
+	if request.Options != nil &&
+		len(request.Options.RetryCodes) == 0 ||
+		response.TxnError == nil {
+		return false
+	}
+
+	select {
+	case <-ctx.Done():
+		return false
+	default:
+		for _, code := range request.Options.RetryCodes {
+			if code == response.TxnError.Code {
+				wait := time.Duration(request.Options.RetryInterval)
+				if wait == 0 {
+					wait = defaultRetryInterval
+				}
+				time.Sleep(wait)
+				return true
+			}
+		}
+		return false
+	}
+}
diff --git a/pkg/dnservice/store_rpc_handler_test.go b/pkg/dnservice/store_rpc_handler_test.go
index 11bab7335..ca1826795 100644
--- a/pkg/dnservice/store_rpc_handler_test.go
+++ b/pkg/dnservice/store_rpc_handler_test.go
@@ -35,6 +35,37 @@ func TestHandleRead(t *testing.T) {
 	})
 }
 
+func TestHandleReadWithRetry(t *testing.T) {
+	runDNStoreTest(t, func(s *store) {
+		req := service.NewTestReadRequest(1, service.NewTestTxn(1, 1, 1), 1)
+		req.CNRequest.Target.ReplicaID = 2
+		req.Options = &txn.TxnRequestOptions{
+			RetryCodes: []txn.ErrorCode{txn.ErrorCode_DNShardNotFound},
+		}
+		go func() {
+			time.Sleep(time.Second)
+			shard := newTestDNShard(1, 2, 3)
+			assert.NoError(t, s.StartDNReplica(shard))
+		}()
+		assert.NoError(t, s.handleRead(context.Background(), &req, &txn.TxnResponse{}))
+	})
+}
+
+func TestHandleReadWithRetryWithTimeout(t *testing.T) {
+	runDNStoreTest(t, func(s *store) {
+		req := service.NewTestReadRequest(1, service.NewTestTxn(1, 1, 1), 1)
+		req.CNRequest.Target.ReplicaID = 2
+		req.Options = &txn.TxnRequestOptions{
+			RetryCodes: []txn.ErrorCode{txn.ErrorCode_DNShardNotFound},
+		}
+		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+		defer cancel()
+		resp := &txn.TxnResponse{}
+		assert.NoError(t, s.handleRead(ctx, &req, resp))
+		assert.Equal(t, txn.ErrorCode_DNShardNotFound, resp.TxnError.Code)
+	})
+}
+
 func TestHandleWrite(t *testing.T) {
 	runDNStoreTest(t, func(s *store) {
 		shard := newTestDNShard(1, 2, 3)
diff --git a/pkg/pb/txn/txn.pb.go b/pkg/pb/txn/txn.pb.go
index e3d753a94..7fcee6cd5 100644
--- a/pkg/pb/txn/txn.pb.go
+++ b/pkg/pb/txn/txn.pb.go
@@ -553,10 +553,12 @@ type TxnRequest struct {
 	// TxnRollbackDNShardRequest corresponds to TxnMethod.RollbackDNShard
 	RollbackDNShardRequest *TxnRollbackDNShardRequest `protobuf:"bytes,11,opt,name=RollbackDNShardRequest,proto3" json:"RollbackDNShardRequest,omitempty"`
 	// TxnRemoveMetadataRequest  corresponds to TxnMethod.RemoveMetadata
-	RemoveMetadata       *TxnRemoveMetadataRequest `protobuf:"bytes,12,opt,name=RemoveMetadata,proto3" json:"RemoveMetadata,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
-	XXX_unrecognized     []byte                    `json:"-"`
-	XXX_sizecache        int32                     `json:"-"`
+	RemoveMetadata *TxnRemoveMetadataRequest `protobuf:"bytes,12,opt,name=RemoveMetadata,proto3" json:"RemoveMetadata,omitempty"`
+	// TxnRequestOptions request options
+	Options              *TxnRequestOptions `protobuf:"bytes,13,opt,name=options,proto3" json:"options,omitempty"`
+	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
+	XXX_unrecognized     []byte             `json:"-"`
+	XXX_sizecache        int32              `json:"-"`
 }
 
 func (m *TxnRequest) Reset()         { *m = TxnRequest{} }
@@ -676,6 +678,72 @@ func (m *TxnRequest) GetRemoveMetadata() *TxnRemoveMetadataRequest {
 	return nil
 }
 
+func (m *TxnRequest) GetOptions() *TxnRequestOptions {
+	if m != nil {
+		return m.Options
+	}
+	return nil
+}
+
+// TxnRequestOptions txn options
+type TxnRequestOptions struct {
+	// RetryCodes when DN processes TxnRequest and encounters the specified error, it needs to retry
+	// on the server side.
+	RetryCodes []ErrorCode `protobuf:"varint,1,rep,packed,name=RetryCodes,proto3,enum=txn.ErrorCode" json:"RetryCodes,omitempty"`
+	// RetryInterval retry interval, default is 100ms.
+	RetryInterval        int64    `protobuf:"varint,2,opt,name=RetryInterval,proto3" json:"RetryInterval,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *TxnRequestOptions) Reset()         { *m = TxnRequestOptions{} }
+func (m *TxnRequestOptions) String() string { return proto.CompactTextString(m) }
+func (*TxnRequestOptions) ProtoMessage()    {}
+func (*TxnRequestOptions) Descriptor() ([]byte, []int) {
+	return fileDescriptor_4f782e76b37adb9a, []int{5}
+}
+func (m *TxnRequestOptions) XXX_Unmarshal(b []byte) error {
+	return m.Unmarshal(b)
+}
+func (m *TxnRequestOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	if deterministic {
+		return xxx_messageInfo_TxnRequestOptions.Marshal(b, m, deterministic)
+	} else {
+		b = b[:cap(b)]
+		n, err := m.MarshalToSizedBuffer(b)
+		if err != nil {
+			return nil, err
+		}
+		return b[:n], nil
+	}
+}
+func (m *TxnRequestOptions) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_TxnRequestOptions.Merge(m, src)
+}
+func (m *TxnRequestOptions) XXX_Size() int {
+	return m.Size()
+}
+func (m *TxnRequestOptions) XXX_DiscardUnknown() {
+	xxx_messageInfo_TxnRequestOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TxnRequestOptions proto.InternalMessageInfo
+
+func (m *TxnRequestOptions) GetRetryCodes() []ErrorCode {
+	if m != nil {
+		return m.RetryCodes
+	}
+	return nil
+}
+
+func (m *TxnRequestOptions) GetRetryInterval() int64 {
+	if m != nil {
+		return m.RetryInterval
+	}
+	return 0
+}
+
 // TxnResponse response of TxnRequest.
 type TxnResponse struct {
 	// RequestID corresponding request id
@@ -716,7 +784,7 @@ func (m *TxnResponse) Reset()         { *m = TxnResponse{} }
 func (m *TxnResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnResponse) ProtoMessage()    {}
 func (*TxnResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{5}
+	return fileDescriptor_4f782e76b37adb9a, []int{6}
 }
 func (m *TxnResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -848,7 +916,7 @@ func (m *TxnCommitRequest) Reset()         { *m = TxnCommitRequest{} }
 func (m *TxnCommitRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnCommitRequest) ProtoMessage()    {}
 func (*TxnCommitRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{6}
+	return fileDescriptor_4f782e76b37adb9a, []int{7}
 }
 func (m *TxnCommitRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -895,7 +963,7 @@ func (m *TxnCommitResponse) Reset()         { *m = TxnCommitResponse{} }
 func (m *TxnCommitResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnCommitResponse) ProtoMessage()    {}
 func (*TxnCommitResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{7}
+	return fileDescriptor_4f782e76b37adb9a, []int{8}
 }
 func (m *TxnCommitResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -935,7 +1003,7 @@ func (m *TxnRollbackRequest) Reset()         { *m = TxnRollbackRequest{} }
 func (m *TxnRollbackRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnRollbackRequest) ProtoMessage()    {}
 func (*TxnRollbackRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{8}
+	return fileDescriptor_4f782e76b37adb9a, []int{9}
 }
 func (m *TxnRollbackRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -975,7 +1043,7 @@ func (m *TxnRollbackResponse) Reset()         { *m = TxnRollbackResponse{} }
 func (m *TxnRollbackResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnRollbackResponse) ProtoMessage()    {}
 func (*TxnRollbackResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{9}
+	return fileDescriptor_4f782e76b37adb9a, []int{10}
 }
 func (m *TxnRollbackResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1019,7 +1087,7 @@ func (m *TxnPrepareRequest) Reset()         { *m = TxnPrepareRequest{} }
 func (m *TxnPrepareRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnPrepareRequest) ProtoMessage()    {}
 func (*TxnPrepareRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{10}
+	return fileDescriptor_4f782e76b37adb9a, []int{11}
 }
 func (m *TxnPrepareRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1066,7 +1134,7 @@ func (m *TxnPrepareResponse) Reset()         { *m = TxnPrepareResponse{} }
 func (m *TxnPrepareResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnPrepareResponse) ProtoMessage()    {}
 func (*TxnPrepareResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{11}
+	return fileDescriptor_4f782e76b37adb9a, []int{12}
 }
 func (m *TxnPrepareResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1108,7 +1176,7 @@ func (m *TxnGetStatusRequest) Reset()         { *m = TxnGetStatusRequest{} }
 func (m *TxnGetStatusRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnGetStatusRequest) ProtoMessage()    {}
 func (*TxnGetStatusRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{12}
+	return fileDescriptor_4f782e76b37adb9a, []int{13}
 }
 func (m *TxnGetStatusRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1155,7 +1223,7 @@ func (m *TxnGetStatusResponse) Reset()         { *m = TxnGetStatusResponse{} }
 func (m *TxnGetStatusResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnGetStatusResponse) ProtoMessage()    {}
 func (*TxnGetStatusResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{13}
+	return fileDescriptor_4f782e76b37adb9a, []int{14}
 }
 func (m *TxnGetStatusResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1198,7 +1266,7 @@ func (m *TxnCommitDNShardRequest) Reset()         { *m = TxnCommitDNShardRequest
 func (m *TxnCommitDNShardRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnCommitDNShardRequest) ProtoMessage()    {}
 func (*TxnCommitDNShardRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{14}
+	return fileDescriptor_4f782e76b37adb9a, []int{15}
 }
 func (m *TxnCommitDNShardRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1245,7 +1313,7 @@ func (m *TxnCommitDNShardResponse) Reset()         { *m = TxnCommitDNShardRespon
 func (m *TxnCommitDNShardResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnCommitDNShardResponse) ProtoMessage()    {}
 func (*TxnCommitDNShardResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{15}
+	return fileDescriptor_4f782e76b37adb9a, []int{16}
 }
 func (m *TxnCommitDNShardResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1287,7 +1355,7 @@ func (m *TxnRollbackDNShardRequest) Reset()         { *m = TxnRollbackDNShardReq
 func (m *TxnRollbackDNShardRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnRollbackDNShardRequest) ProtoMessage()    {}
 func (*TxnRollbackDNShardRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{16}
+	return fileDescriptor_4f782e76b37adb9a, []int{17}
 }
 func (m *TxnRollbackDNShardRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1334,7 +1402,7 @@ func (m *TxnRollbackDNShardResponse) Reset()         { *m = TxnRollbackDNShardRe
 func (m *TxnRollbackDNShardResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnRollbackDNShardResponse) ProtoMessage()    {}
 func (*TxnRollbackDNShardResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{17}
+	return fileDescriptor_4f782e76b37adb9a, []int{18}
 }
 func (m *TxnRollbackDNShardResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1376,7 +1444,7 @@ func (m *TxnRemoveMetadataRequest) Reset()         { *m = TxnRemoveMetadataReque
 func (m *TxnRemoveMetadataRequest) String() string { return proto.CompactTextString(m) }
 func (*TxnRemoveMetadataRequest) ProtoMessage()    {}
 func (*TxnRemoveMetadataRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{18}
+	return fileDescriptor_4f782e76b37adb9a, []int{19}
 }
 func (m *TxnRemoveMetadataRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1423,7 +1491,7 @@ func (m *TxnRemoveMetadataResponse) Reset()         { *m = TxnRemoveMetadataResp
 func (m *TxnRemoveMetadataResponse) String() string { return proto.CompactTextString(m) }
 func (*TxnRemoveMetadataResponse) ProtoMessage()    {}
 func (*TxnRemoveMetadataResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{19}
+	return fileDescriptor_4f782e76b37adb9a, []int{20}
 }
 func (m *TxnRemoveMetadataResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1467,7 +1535,7 @@ func (m *TxnError) Reset()         { *m = TxnError{} }
 func (m *TxnError) String() string { return proto.CompactTextString(m) }
 func (*TxnError) ProtoMessage()    {}
 func (*TxnError) Descriptor() ([]byte, []int) {
-	return fileDescriptor_4f782e76b37adb9a, []int{20}
+	return fileDescriptor_4f782e76b37adb9a, []int{21}
 }
 func (m *TxnError) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1519,6 +1587,7 @@ func init() {
 	proto.RegisterType((*CNOpRequest)(nil), "txn.CNOpRequest")
 	proto.RegisterType((*CNOpResponse)(nil), "txn.CNOpResponse")
 	proto.RegisterType((*TxnRequest)(nil), "txn.TxnRequest")
+	proto.RegisterType((*TxnRequestOptions)(nil), "txn.TxnRequestOptions")
 	proto.RegisterType((*TxnResponse)(nil), "txn.TxnResponse")
 	proto.RegisterType((*TxnCommitRequest)(nil), "txn.TxnCommitRequest")
 	proto.RegisterType((*TxnCommitResponse)(nil), "txn.TxnCommitResponse")
@@ -1540,80 +1609,84 @@ func init() {
 func init() { proto.RegisterFile("txn.proto", fileDescriptor_4f782e76b37adb9a) }
 
 var fileDescriptor_4f782e76b37adb9a = []byte{
-	// 1163 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x6e, 0xdb, 0x36,
-	0x14, 0xae, 0xfc, 0x2b, 0x1d, 0xff, 0x44, 0x61, 0xf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d, 0x53, 0x7b, 0x7f, 0xd7, 0xd4, 0xfe, 0xbe, 0x6b, 0x6a, 0x3f, 0x7e, 0xbe,
-	0xf4, 0x27, 0x67, 0x4a, 0x58, 0xe0, 0x84, 0x5e, 0xe0, 0x8c, 0x1d, 0x57, 0x2d, 0x5c, 0xda, 0xf6,
-	0xdf, 0x8c, 0xdb, 0xfe, 0xb0, 0xcd, 0x42, 0x77, 0x58, 0x12, 0xff, 0x64, 0x9e, 0xfd, 0x17, 0x00,
-	0x00, 0xff, 0xff, 0x4f, 0xcd, 0xe7, 0x39, 0x2b, 0x0d, 0x00, 0x00,
+	// 1224 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0x5b, 0x6e, 0xdb, 0x46,
+	0x17, 0x0e, 0x75, 0x25, 0x8f, 0x2e, 0xa6, 0xc7, 0x37, 0xc6, 0xbf, 0x7f, 0xc5, 0x20, 0x82, 0xc0,
+	0x35, 0x5a, 0xa9, 0x71, 0xd0, 0xa2, 0x68, 0x01, 0x03, 0x8a, 0x2c, 0x27, 0x06, 0x6a, 0xd9, 0x18,
+	0x11, 0x0d, 0xda, 0x97, 0x82, 0xb2, 0xa6, 0x32, 0x11, 0x89, 0x64, 0xc9, 0xb1, 0x41, 0xef, 0xa2,
+	0x9b, 0x68, 0x81, 0xee, 0x24, 0x8f, 0x59, 0x41, 0xd1, 0x1a, 0xe8, 0x0a, 0xba, 0x81, 0x62, 0x86,
+	0x33, 0x94, 0x48, 0x4a, 0x09, 0xe0, 0xbe, 0x71, 0xce, 0xe5, 0x3b, 0x87, 0x9f, 0xce, 0x77, 0x38,
+	0x02, 0x8d, 0x46, 0x6e, 0xdb, 0x0f, 0x3c, 0xea, 0xa1, 0x22, 0x8d, 0xdc, 0xdd, 0xcf, 0x26, 0x0e,
+	0xbd, 0xbe, 0x19, 0xb5, 0xaf, 0xbc, 0x59, 0x67, 0xe2, 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0x15, 0xfe, 0x37, 0xeb, 0xc5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff,
+	0xdd, 0xab, 0xcb, 0xf5, 0xc8, 0x0d, 0x00, 0x00,
 }
 
 func (m *TxnMeta) Marshal() (dAtA []byte, err error) {
@@ -1873,6 +1946,18 @@ func (m *TxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 		i -= len(m.XXX_unrecognized)
 		copy(dAtA[i:], m.XXX_unrecognized)
 	}
+	if m.Options != nil {
+		{
+			size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
+			if err != nil {
+				return 0, err
+			}
+			i -= size
+			i = encodeVarintTxn(dAtA, i, uint64(size))
+		}
+		i--
+		dAtA[i] = 0x6a
+	}
 	if m.RemoveMetadata != nil {
 		{
 			size, err := m.RemoveMetadata.MarshalToSizedBuffer(dAtA[:i])
@@ -1997,6 +2082,56 @@ func (m *TxnRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 	return len(dAtA) - i, nil
 }
 
+func (m *TxnRequestOptions) Marshal() (dAtA []byte, err error) {
+	size := m.Size()
+	dAtA = make([]byte, size)
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
+	if err != nil {
+		return nil, err
+	}
+	return dAtA[:n], nil
+}
+
+func (m *TxnRequestOptions) MarshalTo(dAtA []byte) (int, error) {
+	size := m.Size()
+	return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *TxnRequestOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+	i := len(dAtA)
+	_ = i
+	var l int
+	_ = l
+	if m.XXX_unrecognized != nil {
+		i -= len(m.XXX_unrecognized)
+		copy(dAtA[i:], m.XXX_unrecognized)
+	}
+	if m.RetryInterval != 0 {
+		i = encodeVarintTxn(dAtA, i, uint64(m.RetryInterval))
+		i--
+		dAtA[i] = 0x10
+	}
+	if len(m.RetryCodes) > 0 {
+		dAtA17 := make([]byte, len(m.RetryCodes)*10)
+		var j16 int
+		for _, num := range m.RetryCodes {
+			for num >= 1<<7 {
+				dAtA17[j16] = uint8(uint64(num)&0x7f | 0x80)
+				num >>= 7
+				j16++
+			}
+			dAtA17[j16] = uint8(num)
+			j16++
+		}
+		i -= j16
+		copy(dAtA[i:], dAtA17[:j16])
+		i = encodeVarintTxn(dAtA, i, uint64(j16))
+		i--
+		dAtA[i] = 0xa
+	}
+	return len(dAtA) - i, nil
+}
+
 func (m *TxnResponse) Marshal() (dAtA []byte, err error) {
 	size := m.Size()
 	dAtA = make([]byte, size)
@@ -2787,6 +2922,32 @@ func (m *TxnRequest) Size() (n int) {
 		l = m.RemoveMetadata.Size()
 		n += 1 + l + sovTxn(uint64(l))
 	}
+	if m.Options != nil {
+		l = m.Options.Size()
+		n += 1 + l + sovTxn(uint64(l))
+	}
+	if m.XXX_unrecognized != nil {
+		n += len(m.XXX_unrecognized)
+	}
+	return n
+}
+
+func (m *TxnRequestOptions) Size() (n int) {
+	if m == nil {
+		return 0
+	}
+	var l int
+	_ = l
+	if len(m.RetryCodes) > 0 {
+		l = 0
+		for _, e := range m.RetryCodes {
+			l += sovTxn(uint64(e))
+		}
+		n += 1 + sovTxn(uint64(l)) + l
+	}
+	if m.RetryInterval != 0 {
+		n += 1 + sovTxn(uint64(m.RetryInterval))
+	}
 	if m.XXX_unrecognized != nil {
 		n += len(m.XXX_unrecognized)
 	}
@@ -4070,6 +4231,181 @@ func (m *TxnRequest) Unmarshal(dAtA []byte) error {
 				return err
 			}
 			iNdEx = postIndex
+		case 13:
+			if wireType != 2 {
+				return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
+			}
+			var msglen int
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowTxn
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				msglen |= int(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+			if msglen < 0 {
+				return ErrInvalidLengthTxn
+			}
+			postIndex := iNdEx + msglen
+			if postIndex < 0 {
+				return ErrInvalidLengthTxn
+			}
+			if postIndex > l {
+				return io.ErrUnexpectedEOF
+			}
+			if m.Options == nil {
+				m.Options = &TxnRequestOptions{}
+			}
+			if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+				return err
+			}
+			iNdEx = postIndex
+		default:
+			iNdEx = preIndex
+			skippy, err := skipTxn(dAtA[iNdEx:])
+			if err != nil {
+				return err
+			}
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
+				return ErrInvalidLengthTxn
+			}
+			if (iNdEx + skippy) > l {
+				return io.ErrUnexpectedEOF
+			}
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
+			iNdEx += skippy
+		}
+	}
+
+	if iNdEx > l {
+		return io.ErrUnexpectedEOF
+	}
+	return nil
+}
+func (m *TxnRequestOptions) Unmarshal(dAtA []byte) error {
+	l := len(dAtA)
+	iNdEx := 0
+	for iNdEx < l {
+		preIndex := iNdEx
+		var wire uint64
+		for shift := uint(0); ; shift += 7 {
+			if shift >= 64 {
+				return ErrIntOverflowTxn
+			}
+			if iNdEx >= l {
+				return io.ErrUnexpectedEOF
+			}
+			b := dAtA[iNdEx]
+			iNdEx++
+			wire |= uint64(b&0x7F) << shift
+			if b < 0x80 {
+				break
+			}
+		}
+		fieldNum := int32(wire >> 3)
+		wireType := int(wire & 0x7)
+		if wireType == 4 {
+			return fmt.Errorf("proto: TxnRequestOptions: wiretype end group for non-group")
+		}
+		if fieldNum <= 0 {
+			return fmt.Errorf("proto: TxnRequestOptions: illegal tag %d (wire type %d)", fieldNum, wire)
+		}
+		switch fieldNum {
+		case 1:
+			if wireType == 0 {
+				var v ErrorCode
+				for shift := uint(0); ; shift += 7 {
+					if shift >= 64 {
+						return ErrIntOverflowTxn
+					}
+					if iNdEx >= l {
+						return io.ErrUnexpectedEOF
+					}
+					b := dAtA[iNdEx]
+					iNdEx++
+					v |= ErrorCode(b&0x7F) << shift
+					if b < 0x80 {
+						break
+					}
+				}
+				m.RetryCodes = append(m.RetryCodes, v)
+			} else if wireType == 2 {
+				var packedLen int
+				for shift := uint(0); ; shift += 7 {
+					if shift >= 64 {
+						return ErrIntOverflowTxn
+					}
+					if iNdEx >= l {
+						return io.ErrUnexpectedEOF
+					}
+					b := dAtA[iNdEx]
+					iNdEx++
+					packedLen |= int(b&0x7F) << shift
+					if b < 0x80 {
+						break
+					}
+				}
+				if packedLen < 0 {
+					return ErrInvalidLengthTxn
+				}
+				postIndex := iNdEx + packedLen
+				if postIndex < 0 {
+					return ErrInvalidLengthTxn
+				}
+				if postIndex > l {
+					return io.ErrUnexpectedEOF
+				}
+				var elementCount int
+				if elementCount != 0 && len(m.RetryCodes) == 0 {
+					m.RetryCodes = make([]ErrorCode, 0, elementCount)
+				}
+				for iNdEx < postIndex {
+					var v ErrorCode
+					for shift := uint(0); ; shift += 7 {
+						if shift >= 64 {
+							return ErrIntOverflowTxn
+						}
+						if iNdEx >= l {
+							return io.ErrUnexpectedEOF
+						}
+						b := dAtA[iNdEx]
+						iNdEx++
+						v |= ErrorCode(b&0x7F) << shift
+						if b < 0x80 {
+							break
+						}
+					}
+					m.RetryCodes = append(m.RetryCodes, v)
+				}
+			} else {
+				return fmt.Errorf("proto: wrong wireType = %d for field RetryCodes", wireType)
+			}
+		case 2:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field RetryInterval", wireType)
+			}
+			m.RetryInterval = 0
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowTxn
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				m.RetryInterval |= int64(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
 		default:
 			iNdEx = preIndex
 			skippy, err := skipTxn(dAtA[iNdEx:])
diff --git a/proto/txn.proto b/proto/txn.proto
index 494871758..26d17152a 100644
--- a/proto/txn.proto
+++ b/proto/txn.proto
@@ -188,6 +188,17 @@ message TxnRequest {
     TxnRollbackDNShardRequest   RollbackDNShardRequest   = 11;
     // TxnRemoveMetadataRequest  corresponds to TxnMethod.RemoveMetadata
     TxnRemoveMetadataRequest    RemoveMetadata           = 12;
+    // TxnRequestOptions request options
+    TxnRequestOptions           Options                  = 13;
+}
+
+// TxnRequestOptions txn options
+message TxnRequestOptions {
+    // RetryCodes when DN processes TxnRequest and encounters the specified error, it needs to retry
+    // on the server side. Only read and write can retry.
+    repeated ErrorCode RetryCodes    = 1;
+    // RetryInterval retry interval, default is 100ms.
+    int64              RetryInterval = 2;    
 }
 
 // TxnResponse response of TxnRequest.
-- 
GitLab