Repository: matrixorigin/matrixone
Pull request #3835 (2022-07-08 15:22:22)

logservice: added tso support
**What type of PR is this?**

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [x] Feature
- [ ] Test and CI
- [ ] Code Refactoring

**Which issue(s) this PR fixes:**

issue #

**What this PR does / why we need it:**

Added TSO support in LogService. 

**Special notes for your reviewer:**

Not Available

**Additional documentation (e.g. design docs, usage docs, etc.):**

Not Available


lni: sad, test is still flaky. do not merge
lni: test fixed. do-not-merge/wip tag removed. ready to be auto-merged once reviewed. 

Patch:
diff --git a/pkg/logservice/client.go b/pkg/logservice/client.go
index e4e3b17ba..60a201eb9 100644
--- a/pkg/logservice/client.go
+++ b/pkg/logservice/client.go
@@ -68,14 +68,15 @@ type Client interface {
 	Read(ctx context.Context, firstIndex Lsn, maxSize uint64) ([]pb.LogRecord, Lsn, error)
 	Truncate(ctx context.Context, index Lsn) error
 	GetTruncatedIndex(ctx context.Context) (Lsn, error)
+	GetTSOTimestamp(ctx context.Context, count uint64) (uint64, error)
 }
 
 type client struct {
-	cfg    ClientConfig
-	client morpc.RPCClient
-	addr   string
-	req    *RPCRequest
-	pool   *sync.Pool
+	cfg      ClientConfig
+	client   morpc.RPCClient
+	addr     string
+	pool     *sync.Pool
+	respPool *sync.Pool
 }
 
 var _ Client = (*client)(nil)
@@ -88,16 +89,20 @@ func CreateClient(ctx context.Context,
 	cfg ClientConfig) (Client, error) {
 	pool := &sync.Pool{}
 	pool.New = func() interface{} {
-		return &RPCResponse{pool: pool}
+		return &RPCRequest{pool: pool}
+	}
+	respPool := &sync.Pool{}
+	respPool.New = func() interface{} {
+		return &RPCResponse{pool: respPool}
 	}
 	c := &client{
-		cfg:  cfg,
-		req:  &RPCRequest{},
-		pool: pool,
+		cfg:      cfg,
+		pool:     pool,
+		respPool: respPool,
 	}
 	var e error
 	for _, addr := range cfg.ServiceAddresses {
-		cc, err := getRPCClient(ctx, addr, c.pool)
+		cc, err := getRPCClient(ctx, addr, c.respPool)
 		if err != nil {
 			e = err
 			continue
@@ -168,6 +173,13 @@ func (c *client) GetTruncatedIndex(ctx context.Context) (Lsn, error) {
 	return c.getTruncatedIndex(ctx)
 }
 
+// GetTSOTimestamp requests a total of count unique timestamps from the TSO and
+// return the first assigned such timestamp, that is TSO timestamps
+// [returned value, returned value + count] will be owned by the caller.
+func (c *client) GetTSOTimestamp(ctx context.Context, count uint64) (uint64, error) {
+	return c.tsoRequest(ctx, count)
+}
+
 func (c *client) readOnly() bool {
 	return c.cfg.ReadOnly
 }
@@ -200,10 +212,11 @@ func (c *client) request(ctx context.Context,
 			MaxSize: maxSize,
 		},
 	}
-	c.req.Request = req
-	c.req.payload = payload
+	r := c.pool.Get().(*RPCRequest)
+	r.Request = req
+	r.payload = payload
 	future, err := c.client.Send(ctx,
-		c.addr, c.req, morpc.SendOptions{Timeout: time.Duration(timeout)})
+		c.addr, r, morpc.SendOptions{Timeout: time.Duration(timeout)})
 	if err != nil {
 		return pb.Response{}, nil, err
 	}
@@ -229,6 +242,43 @@ func (c *client) request(ctx context.Context,
 	return resp, recs.Records, nil
 }
 
+func (c *client) tsoRequest(ctx context.Context, count uint64) (uint64, error) {
+	timeout, err := getTimeoutFromContext(ctx)
+	if err != nil {
+		return 0, err
+	}
+	req := pb.Request{
+		Method:  pb.TSO_UPDATE,
+		Timeout: int64(timeout),
+		TsoRequest: pb.TsoRequest{
+			Count: count,
+		},
+	}
+	r := c.pool.Get().(*RPCRequest)
+	r.Request = req
+	future, err := c.client.Send(ctx,
+		c.addr, r, morpc.SendOptions{Timeout: time.Duration(timeout)})
+	if err != nil {
+		return 0, err
+	}
+	defer future.Close()
+	msg, err := future.Get()
+	if err != nil {
+		return 0, err
+	}
+	response, ok := msg.(*RPCResponse)
+	if !ok {
+		panic("unexpected response type")
+	}
+	resp := response.Response
+	defer response.Release()
+	err = toError(response.Response)
+	if err != nil {
+		return 0, err
+	}
+	return resp.TsoResponse.Value, nil
+}
+
 func (c *client) connect(ctx context.Context, mt pb.MethodType) error {
 	_, _, err := c.request(ctx, mt, nil, 0, 0)
 	return err
diff --git a/pkg/logservice/message.go b/pkg/logservice/message.go
new file mode 100644
index 000000000..82935cf7d
--- /dev/null
+++ b/pkg/logservice/message.go
@@ -0,0 +1,96 @@
+// Copyright 2021 - 2022 Matrix Origin
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package logservice
+
+import (
+	"sync"
+
+	"github.com/matrixorigin/matrixone/pkg/common/morpc"
+	pb "github.com/matrixorigin/matrixone/pkg/pb/logservice"
+)
+
+// RPCRequest is request message type used in morpc
+type RPCRequest struct {
+	pb.Request
+	payload []byte
+	pool    *sync.Pool
+}
+
+var _ morpc.PayloadMessage = (*RPCRequest)(nil)
+
+func (r *RPCRequest) Release() {
+	if r.pool != nil {
+		r.Request = pb.Request{}
+		r.payload = nil
+		r.pool.Put(r)
+	}
+}
+
+func (r *RPCRequest) SetID(id uint64) {
+	r.RequestID = id
+}
+
+func (r *RPCRequest) GetID() uint64 {
+	return r.RequestID
+}
+
+func (r *RPCRequest) DebugString() string {
+	return ""
+}
+
+func (r *RPCRequest) GetPayloadField() []byte {
+	return r.payload
+}
+
+func (r *RPCRequest) SetPayloadField(data []byte) {
+	r.payload = data
+}
+
+// RPCResponse is response message type used in morpc
+type RPCResponse struct {
+	pb.Response
+	payload []byte
+	pool    *sync.Pool
+}
+
+var _ morpc.PayloadMessage = (*RPCResponse)(nil)
+
+func (r *RPCResponse) Release() {
+	if r.pool != nil {
+		r.Response = pb.Response{}
+		r.payload = nil
+		r.pool.Put(r)
+	}
+}
+
+func (r *RPCResponse) SetID(id uint64) {
+	r.RequestID = id
+}
+
+func (r *RPCResponse) GetID() uint64 {
+	return r.RequestID
+}
+
+func (r *RPCResponse) DebugString() string {
+	return ""
+}
+
+func (r *RPCResponse) GetPayloadField() []byte {
+	return r.payload
+}
+
+func (r *RPCResponse) SetPayloadField(data []byte) {
+	r.payload = data
+}
diff --git a/pkg/logservice/rsm.go b/pkg/logservice/rsm.go
index 7f7ad11fb..c74f4d216 100644
--- a/pkg/logservice/rsm.go
+++ b/pkg/logservice/rsm.go
@@ -28,7 +28,8 @@ var (
 )
 
 const (
-	headerSize = 2
+	firstLogShardID uint64 = 1
+	headerSize             = 2
 )
 
 const (
@@ -36,6 +37,7 @@ const (
 	truncatedIndexTag
 	userEntryTag
 	indexTag
+	tsoTag
 )
 
 // used to indicate query types
@@ -65,6 +67,10 @@ func parseLeaseHolderID(cmd []byte) uint64 {
 	return binaryEnc.Uint64(cmd[headerSize:])
 }
 
+func parseTsoUpdateCmd(cmd []byte) uint64 {
+	return binaryEnc.Uint64(cmd[headerSize:])
+}
+
 func getSetLeaseHolderCmd(leaseHolderID uint64) []byte {
 	cmd := make([]byte, headerSize+8)
 	binaryEnc.PutUint16(cmd, leaseHolderIDTag)
@@ -79,6 +85,20 @@ func getSetTruncatedIndexCmd(index uint64) []byte {
 	return cmd
 }
 
+func getTsoUpdateCmd(count uint64) []byte {
+	cmd := make([]byte, headerSize+8)
+	binaryEnc.PutUint16(cmd, tsoTag)
+	binaryEnc.PutUint64(cmd[headerSize:], count)
+	return cmd
+}
+
+func isTsoUpdate(cmd []byte) bool {
+	if len(cmd) != headerSize+8 {
+		return false
+	}
+	return parseCmdTag(cmd) == tsoTag
+}
+
 func isSetLeaseHolderUpdate(cmd []byte) bool {
 	return tagMatch(cmd, leaseHolderIDTag)
 }
@@ -111,6 +131,7 @@ var _ (sm.IStateMachine) = (*stateMachine)(nil)
 
 func newStateMachine(shardID uint64, replicaID uint64) sm.IStateMachine {
 	state := pb.RSMState{
+		Tso:          1,
 		LeaseHistory: make(map[uint64]uint64),
 	}
 	return &stateMachine{
@@ -172,6 +193,13 @@ func (s *stateMachine) handleUserUpdate(cmd []byte) sm.Result {
 	return sm.Result{Value: s.state.Index}
 }
 
+func (s *stateMachine) handleTsoUpdate(cmd []byte) sm.Result {
+	count := parseTsoUpdateCmd(cmd)
+	result := sm.Result{Value: s.state.Tso}
+	s.state.Tso += count
+	return result
+}
+
 func (s *stateMachine) Close() error {
 	return nil
 }
@@ -185,6 +213,8 @@ func (s *stateMachine) Update(e sm.Entry) (sm.Result, error) {
 		return s.handleTruncateIndex(cmd), nil
 	} else if isUserUpdate(cmd) {
 		return s.handleUserUpdate(cmd), nil
+	} else if isTsoUpdate(cmd) {
+		return s.handleTsoUpdate(cmd), nil
 	}
 	panic("corrupted entry")
 }
diff --git a/pkg/logservice/service.go b/pkg/logservice/service.go
index ada2406bc..61736c421 100644
--- a/pkg/logservice/service.go
+++ b/pkg/logservice/service.go
@@ -46,78 +46,6 @@ func firstError(err1 error, err2 error) error {
 	return err2
 }
 
-// RPCRequest is request message type used in morpc
-type RPCRequest struct {
-	pb.Request
-	payload []byte
-	pool    *sync.Pool
-}
-
-var _ morpc.PayloadMessage = (*RPCRequest)(nil)
-
-func (r *RPCRequest) Release() {
-	if r.pool != nil {
-		r.payload = nil
-		r.pool.Put(r)
-	}
-}
-
-func (r *RPCRequest) SetID(id uint64) {
-	r.RequestID = id
-}
-
-func (r *RPCRequest) GetID() uint64 {
-	return r.RequestID
-}
-
-func (r *RPCRequest) DebugString() string {
-	return ""
-}
-
-func (r *RPCRequest) GetPayloadField() []byte {
-	return r.payload
-}
-
-func (r *RPCRequest) SetPayloadField(data []byte) {
-	r.payload = data
-}
-
-// RPCResponse is response message type used in morpc
-type RPCResponse struct {
-	pb.Response
-	payload []byte
-	pool    *sync.Pool
-}
-
-var _ morpc.PayloadMessage = (*RPCResponse)(nil)
-
-func (r *RPCResponse) Release() {
-	if r.pool != nil {
-		r.payload = nil
-		r.pool.Put(r)
-	}
-}
-
-func (r *RPCResponse) SetID(id uint64) {
-	r.RequestID = id
-}
-
-func (r *RPCResponse) GetID() uint64 {
-	return r.RequestID
-}
-
-func (r *RPCResponse) DebugString() string {
-	return ""
-}
-
-func (r *RPCResponse) GetPayloadField() []byte {
-	return r.payload
-}
-
-func (r *RPCResponse) SetPayloadField(data []byte) {
-	r.payload = data
-}
-
 // Service is the top layer component of a log service node. It manages the
 // underlying log store which in turn manages all log shards including the
 // HAKeeper shard. The Log Service component communicates with LogService
@@ -220,10 +148,8 @@ func (s *Service) handleRPCRequest(req morpc.Message,
 func (s *Service) handle(req pb.Request,
 	payload []byte) (pb.Response, pb.LogRecordResponse) {
 	switch req.Method {
-	case pb.CREATE:
-		panic("not implemented")
-	case pb.DESTROY:
-		panic("not implemented")
+	case pb.TSO_UPDATE:
+		return s.handleTsoUpdate(req), pb.LogRecordResponse{}
 	case pb.APPEND:
 		return s.handleAppend(req, payload), pb.LogRecordResponse{}
 	case pb.READ:
@@ -249,6 +175,19 @@ func getResponse(req pb.Request) pb.Response {
 	return pb.Response{Method: req.Method}
 }
 
+func (s *Service) handleTsoUpdate(req pb.Request) pb.Response {
+	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(req.Timeout))
+	defer cancel()
+	r := req.TsoRequest
+	resp := getResponse(req)
+	if v, err := s.store.TsoUpdate(ctx, r.Count); err != nil {
+		resp.ErrorCode, resp.ErrorMessage = toErrorCode(err)
+	} else {
+		resp.TsoResponse.Value = v
+	}
+	return resp
+}
+
 func (s *Service) handleConnect(req pb.Request) pb.Response {
 	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(req.Timeout))
 	defer cancel()
diff --git a/pkg/logservice/store.go b/pkg/logservice/store.go
index a8a5a71c8..a5b739e9a 100644
--- a/pkg/logservice/store.go
+++ b/pkg/logservice/store.go
@@ -322,6 +322,17 @@ func (l *store) GetTruncatedIndex(ctx context.Context,
 	return v.(uint64), nil
 }
 
+func (l *store) TsoUpdate(ctx context.Context, count uint64) (uint64, error) {
+	cmd := getTsoUpdateCmd(count)
+	session := l.nh.GetNoOPSession(firstLogShardID)
+	result, err := l.propose(ctx, session, cmd)
+	if err != nil {
+		plog.Errorf("failed to propose tso update, %v", err)
+		return 0, err
+	}
+	return result.Value, nil
+}
+
 func (l *store) AddLogStoreHeartbeat(ctx context.Context,
 	hb pb.LogStoreHeartbeat) error {
 	data := MustMarshal(&hb)
diff --git a/pkg/pb/logservice/logservice.pb.go b/pkg/pb/logservice/logservice.pb.go
index 3594ca70e..4d63101f6 100644
--- a/pkg/pb/logservice/logservice.pb.go
+++ b/pkg/pb/logservice/logservice.pb.go
@@ -28,42 +28,39 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
 type MethodType int32
 
 const (
-	CREATE        MethodType = 0
-	DESTROY       MethodType = 1
-	APPEND        MethodType = 2
-	READ          MethodType = 3
-	TRUNCATE      MethodType = 4
-	GET_TRUNCATE  MethodType = 5
-	CONNECT       MethodType = 6
-	CONNECT_RO    MethodType = 7
-	LOG_HEARTBEAT MethodType = 8
-	DN_HEARTBEAT  MethodType = 9
+	TSO_UPDATE    MethodType = 0
+	APPEND        MethodType = 1
+	READ          MethodType = 2
+	TRUNCATE      MethodType = 3
+	GET_TRUNCATE  MethodType = 4
+	CONNECT       MethodType = 5
+	CONNECT_RO    MethodType = 6
+	LOG_HEARTBEAT MethodType = 7
+	DN_HEARTBEAT  MethodType = 8
 )
 
 var MethodType_name = map[int32]string{
-	0: "CREATE",
-	1: "DESTROY",
-	2: "APPEND",
-	3: "READ",
-	4: "TRUNCATE",
-	5: "GET_TRUNCATE",
-	6: "CONNECT",
-	7: "CONNECT_RO",
-	8: "LOG_HEARTBEAT",
-	9: "DN_HEARTBEAT",
+	0: "TSO_UPDATE",
+	1: "APPEND",
+	2: "READ",
+	3: "TRUNCATE",
+	4: "GET_TRUNCATE",
+	5: "CONNECT",
+	6: "CONNECT_RO",
+	7: "LOG_HEARTBEAT",
+	8: "DN_HEARTBEAT",
 }
 
 var MethodType_value = map[string]int32{
-	"CREATE":        0,
-	"DESTROY":       1,
-	"APPEND":        2,
-	"READ":          3,
-	"TRUNCATE":      4,
-	"GET_TRUNCATE":  5,
-	"CONNECT":       6,
-	"CONNECT_RO":    7,
-	"LOG_HEARTBEAT": 8,
-	"DN_HEARTBEAT":  9,
+	"TSO_UPDATE":    0,
+	"APPEND":        1,
+	"READ":          2,
+	"TRUNCATE":      3,
+	"GET_TRUNCATE":  4,
+	"CONNECT":       5,
+	"CONNECT_RO":    6,
+	"LOG_HEARTBEAT": 7,
+	"DN_HEARTBEAT":  8,
 }
 
 func (x MethodType) String() string {
@@ -602,10 +599,11 @@ func (m *DNStoreHeartbeat) GetShards() []DNShardInfo {
 }
 
 type RSMState struct {
-	Index                uint64            `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"`
-	LeaseHolderID        uint64            `protobuf:"varint,2,opt,name=LeaseHolderID,proto3" json:"LeaseHolderID,omitempty"`
-	TruncatedIndex       uint64            `protobuf:"varint,3,opt,name=TruncatedIndex,proto3" json:"TruncatedIndex,omitempty"`
-	LeaseHistory         map[uint64]uint64 `protobuf:"bytes,4,rep,name=LeaseHistory,proto3" json:"LeaseHistory,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+	Tso                  uint64            `protobuf:"varint,1,opt,name=Tso,proto3" json:"Tso,omitempty"`
+	Index                uint64            `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"`
+	LeaseHolderID        uint64            `protobuf:"varint,3,opt,name=LeaseHolderID,proto3" json:"LeaseHolderID,omitempty"`
+	TruncatedIndex       uint64            `protobuf:"varint,4,opt,name=TruncatedIndex,proto3" json:"TruncatedIndex,omitempty"`
+	LeaseHistory         map[uint64]uint64 `protobuf:"bytes,5,rep,name=LeaseHistory,proto3" json:"LeaseHistory,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
 	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
 	XXX_unrecognized     []byte            `json:"-"`
 	XXX_sizecache        int32             `json:"-"`
@@ -644,6 +642,13 @@ func (m *RSMState) XXX_DiscardUnknown() {
 
 var xxx_messageInfo_RSMState proto.InternalMessageInfo
 
+func (m *RSMState) GetTso() uint64 {
+	if m != nil {
+		return m.Tso
+	}
+	return 0
+}
+
 func (m *RSMState) GetIndex() uint64 {
 	if m != nil {
 		return m.Index
@@ -823,6 +828,53 @@ func (m *LogRequest) GetDNID() uint64 {
 	return 0
 }
 
+type TsoRequest struct {
+	Count                uint64   `protobuf:"varint,1,opt,name=Count,proto3" json:"Count,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *TsoRequest) Reset()         { *m = TsoRequest{} }
+func (m *TsoRequest) String() string { return proto.CompactTextString(m) }
+func (*TsoRequest) ProtoMessage()    {}
+func (*TsoRequest) Descriptor() ([]byte, []int) {
+	return fileDescriptor_fd1040c5381ab5a7, []int{8}
+}
+func (m *TsoRequest) XXX_Unmarshal(b []byte) error {
+	return m.Unmarshal(b)
+}
+func (m *TsoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	if deterministic {
+		return xxx_messageInfo_TsoRequest.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 *TsoRequest) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_TsoRequest.Merge(m, src)
+}
+func (m *TsoRequest) XXX_Size() int {
+	return m.Size()
+}
+func (m *TsoRequest) XXX_DiscardUnknown() {
+	xxx_messageInfo_TsoRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TsoRequest proto.InternalMessageInfo
+
+func (m *TsoRequest) GetCount() uint64 {
+	if m != nil {
+		return m.Count
+	}
+	return 0
+}
+
 type Request struct {
 	RequestID            uint64            `protobuf:"varint,1,opt,name=RequestID,proto3" json:"RequestID,omitempty"`
 	Method               MethodType        `protobuf:"varint,2,opt,name=Method,proto3,enum=logservice.MethodType" json:"Method,omitempty"`
@@ -830,6 +882,7 @@ type Request struct {
 	LogRequest           LogRequest        `protobuf:"bytes,4,opt,name=LogRequest,proto3" json:"LogRequest"`
 	LogHeartbeat         LogStoreHeartbeat `protobuf:"bytes,5,opt,name=LogHeartbeat,proto3" json:"LogHeartbeat"`
 	DNHeartbeat          DNStoreHeartbeat  `protobuf:"bytes,6,opt,name=DNHeartbeat,proto3" json:"DNHeartbeat"`
+	TsoRequest           TsoRequest        `protobuf:"bytes,7,opt,name=TsoRequest,proto3" json:"TsoRequest"`
 	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
 	XXX_unrecognized     []byte            `json:"-"`
 	XXX_sizecache        int32             `json:"-"`
@@ -839,7 +892,7 @@ func (m *Request) Reset()         { *m = Request{} }
 func (m *Request) String() string { return proto.CompactTextString(m) }
 func (*Request) ProtoMessage()    {}
 func (*Request) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{8}
+	return fileDescriptor_fd1040c5381ab5a7, []int{9}
 }
 func (m *Request) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -879,7 +932,7 @@ func (m *Request) GetMethod() MethodType {
 	if m != nil {
 		return m.Method
 	}
-	return CREATE
+	return TSO_UPDATE
 }
 
 func (m *Request) GetTimeout() int64 {
@@ -910,6 +963,13 @@ func (m *Request) GetDNHeartbeat() DNStoreHeartbeat {
 	return DNStoreHeartbeat{}
 }
 
+func (m *Request) GetTsoRequest() TsoRequest {
+	if m != nil {
+		return m.TsoRequest
+	}
+	return TsoRequest{}
+}
+
 type LogResponse struct {
 	ShardID              uint64   `protobuf:"varint,1,opt,name=ShardID,proto3" json:"ShardID,omitempty"`
 	Index                uint64   `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"`
@@ -923,7 +983,7 @@ func (m *LogResponse) Reset()         { *m = LogResponse{} }
 func (m *LogResponse) String() string { return proto.CompactTextString(m) }
 func (*LogResponse) ProtoMessage()    {}
 func (*LogResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{9}
+	return fileDescriptor_fd1040c5381ab5a7, []int{10}
 }
 func (m *LogResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -980,6 +1040,7 @@ type Response struct {
 	ErrorMessage         string       `protobuf:"bytes,4,opt,name=ErrorMessage,proto3" json:"ErrorMessage,omitempty"`
 	LogResponse          LogResponse  `protobuf:"bytes,5,opt,name=LogResponse,proto3" json:"LogResponse"`
 	CommandBatch         CommandBatch `protobuf:"bytes,6,opt,name=CommandBatch,proto3" json:"CommandBatch"`
+	TsoResponse          TsoResponse  `protobuf:"bytes,7,opt,name=TsoResponse,proto3" json:"TsoResponse"`
 	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
 	XXX_unrecognized     []byte       `json:"-"`
 	XXX_sizecache        int32        `json:"-"`
@@ -989,7 +1050,7 @@ func (m *Response) Reset()         { *m = Response{} }
 func (m *Response) String() string { return proto.CompactTextString(m) }
 func (*Response) ProtoMessage()    {}
 func (*Response) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{10}
+	return fileDescriptor_fd1040c5381ab5a7, []int{11}
 }
 func (m *Response) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1029,7 +1090,7 @@ func (m *Response) GetMethod() MethodType {
 	if m != nil {
 		return m.Method
 	}
-	return CREATE
+	return TSO_UPDATE
 }
 
 func (m *Response) GetErrorCode() ErrorCode {
@@ -1060,6 +1121,13 @@ func (m *Response) GetCommandBatch() CommandBatch {
 	return CommandBatch{}
 }
 
+func (m *Response) GetTsoResponse() TsoResponse {
+	if m != nil {
+		return m.TsoResponse
+	}
+	return TsoResponse{}
+}
+
 type LogRecordResponse struct {
 	Records              []LogRecord `protobuf:"bytes,1,rep,name=Records,proto3" json:"Records"`
 	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
@@ -1071,7 +1139,7 @@ func (m *LogRecordResponse) Reset()         { *m = LogRecordResponse{} }
 func (m *LogRecordResponse) String() string { return proto.CompactTextString(m) }
 func (*LogRecordResponse) ProtoMessage()    {}
 func (*LogRecordResponse) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{11}
+	return fileDescriptor_fd1040c5381ab5a7, []int{12}
 }
 func (m *LogRecordResponse) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1107,6 +1175,53 @@ func (m *LogRecordResponse) GetRecords() []LogRecord {
 	return nil
 }
 
+type TsoResponse struct {
+	Value                uint64   `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *TsoResponse) Reset()         { *m = TsoResponse{} }
+func (m *TsoResponse) String() string { return proto.CompactTextString(m) }
+func (*TsoResponse) ProtoMessage()    {}
+func (*TsoResponse) Descriptor() ([]byte, []int) {
+	return fileDescriptor_fd1040c5381ab5a7, []int{13}
+}
+func (m *TsoResponse) XXX_Unmarshal(b []byte) error {
+	return m.Unmarshal(b)
+}
+func (m *TsoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	if deterministic {
+		return xxx_messageInfo_TsoResponse.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 *TsoResponse) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_TsoResponse.Merge(m, src)
+}
+func (m *TsoResponse) XXX_Size() int {
+	return m.Size()
+}
+func (m *TsoResponse) XXX_DiscardUnknown() {
+	xxx_messageInfo_TsoResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TsoResponse proto.InternalMessageInfo
+
+func (m *TsoResponse) GetValue() uint64 {
+	if m != nil {
+		return m.Value
+	}
+	return 0
+}
+
 // Replica of the shard
 type Replica struct {
 	// UUID which store the Replica is located in
@@ -1123,7 +1238,7 @@ func (m *Replica) Reset()         { *m = Replica{} }
 func (m *Replica) String() string { return proto.CompactTextString(m) }
 func (*Replica) ProtoMessage()    {}
 func (*Replica) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{12}
+	return fileDescriptor_fd1040c5381ab5a7, []int{14}
 }
 func (m *Replica) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1195,7 +1310,7 @@ func (m *ConfigChange) Reset()         { *m = ConfigChange{} }
 func (m *ConfigChange) String() string { return proto.CompactTextString(m) }
 func (*ConfigChange) ProtoMessage()    {}
 func (*ConfigChange) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{13}
+	return fileDescriptor_fd1040c5381ab5a7, []int{15}
 }
 func (m *ConfigChange) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1257,7 +1372,7 @@ func (m *ShutdownStore) Reset()         { *m = ShutdownStore{} }
 func (m *ShutdownStore) String() string { return proto.CompactTextString(m) }
 func (*ShutdownStore) ProtoMessage()    {}
 func (*ShutdownStore) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{14}
+	return fileDescriptor_fd1040c5381ab5a7, []int{16}
 }
 func (m *ShutdownStore) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1310,7 +1425,7 @@ func (m *ScheduleCommand) Reset()         { *m = ScheduleCommand{} }
 func (m *ScheduleCommand) String() string { return proto.CompactTextString(m) }
 func (*ScheduleCommand) ProtoMessage()    {}
 func (*ScheduleCommand) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{15}
+	return fileDescriptor_fd1040c5381ab5a7, []int{17}
 }
 func (m *ScheduleCommand) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1386,7 +1501,7 @@ func (m *CommandBatch) Reset()         { *m = CommandBatch{} }
 func (m *CommandBatch) String() string { return proto.CompactTextString(m) }
 func (*CommandBatch) ProtoMessage()    {}
 func (*CommandBatch) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{16}
+	return fileDescriptor_fd1040c5381ab5a7, []int{18}
 }
 func (m *CommandBatch) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1442,7 +1557,7 @@ func (m *DNStoreInfo) Reset()         { *m = DNStoreInfo{} }
 func (m *DNStoreInfo) String() string { return proto.CompactTextString(m) }
 func (*DNStoreInfo) ProtoMessage()    {}
 func (*DNStoreInfo) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{17}
+	return fileDescriptor_fd1040c5381ab5a7, []int{19}
 }
 func (m *DNStoreInfo) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1499,7 +1614,7 @@ func (m *DNState) Reset()         { *m = DNState{} }
 func (m *DNState) String() string { return proto.CompactTextString(m) }
 func (*DNState) ProtoMessage()    {}
 func (*DNState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{18}
+	return fileDescriptor_fd1040c5381ab5a7, []int{20}
 }
 func (m *DNState) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1550,7 +1665,7 @@ func (m *ClusterInfo) Reset()         { *m = ClusterInfo{} }
 func (m *ClusterInfo) String() string { return proto.CompactTextString(m) }
 func (*ClusterInfo) ProtoMessage()    {}
 func (*ClusterInfo) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{19}
+	return fileDescriptor_fd1040c5381ab5a7, []int{21}
 }
 func (m *ClusterInfo) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1606,7 +1721,7 @@ func (m *InitialClusterRequest) Reset()         { *m = InitialClusterRequest{} }
 func (m *InitialClusterRequest) String() string { return proto.CompactTextString(m) }
 func (*InitialClusterRequest) ProtoMessage()    {}
 func (*InitialClusterRequest) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{20}
+	return fileDescriptor_fd1040c5381ab5a7, []int{22}
 }
 func (m *InitialClusterRequest) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1672,7 +1787,7 @@ func (m *LogStoreInfo) Reset()         { *m = LogStoreInfo{} }
 func (m *LogStoreInfo) String() string { return proto.CompactTextString(m) }
 func (*LogStoreInfo) ProtoMessage()    {}
 func (*LogStoreInfo) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{21}
+	return fileDescriptor_fd1040c5381ab5a7, []int{23}
 }
 func (m *LogStoreInfo) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1755,7 +1870,7 @@ func (m *LogState) Reset()         { *m = LogState{} }
 func (m *LogState) String() string { return proto.CompactTextString(m) }
 func (*LogState) ProtoMessage()    {}
 func (*LogState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{22}
+	return fileDescriptor_fd1040c5381ab5a7, []int{24}
 }
 func (m *LogState) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1815,7 +1930,7 @@ func (m *CheckerState) Reset()         { *m = CheckerState{} }
 func (m *CheckerState) String() string { return proto.CompactTextString(m) }
 func (*CheckerState) ProtoMessage()    {}
 func (*CheckerState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{23}
+	return fileDescriptor_fd1040c5381ab5a7, []int{25}
 }
 func (m *CheckerState) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -1899,7 +2014,7 @@ func (m *HAKeeperRSMState) Reset()         { *m = HAKeeperRSMState{} }
 func (m *HAKeeperRSMState) String() string { return proto.CompactTextString(m) }
 func (*HAKeeperRSMState) ProtoMessage()    {}
 func (*HAKeeperRSMState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_fd1040c5381ab5a7, []int{24}
+	return fileDescriptor_fd1040c5381ab5a7, []int{26}
 }
 func (m *HAKeeperRSMState) XXX_Unmarshal(b []byte) error {
 	return m.Unmarshal(b)
@@ -2008,10 +2123,12 @@ func init() {
 	proto.RegisterMapType((map[uint64]uint64)(nil), "logservice.RSMState.LeaseHistoryEntry")
 	proto.RegisterType((*LogRecord)(nil), "logservice.LogRecord")
 	proto.RegisterType((*LogRequest)(nil), "logservice.LogRequest")
+	proto.RegisterType((*TsoRequest)(nil), "logservice.TsoRequest")
 	proto.RegisterType((*Request)(nil), "logservice.Request")
 	proto.RegisterType((*LogResponse)(nil), "logservice.LogResponse")
 	proto.RegisterType((*Response)(nil), "logservice.Response")
 	proto.RegisterType((*LogRecordResponse)(nil), "logservice.LogRecordResponse")
+	proto.RegisterType((*TsoResponse)(nil), "logservice.TsoResponse")
 	proto.RegisterType((*Replica)(nil), "logservice.Replica")
 	proto.RegisterType((*ConfigChange)(nil), "logservice.ConfigChange")
 	proto.RegisterMapType((map[uint64]string)(nil), "logservice.ConfigChange.InitialMembersEntry")
@@ -2036,129 +2153,133 @@ func init() {
 func init() { proto.RegisterFile("logservice.proto", fileDescriptor_fd1040c5381ab5a7) }
 
 var fileDescriptor_fd1040c5381ab5a7 = []byte{
-	// 1947 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x4f, 0x6f, 0x23, 0x49,
-	0x15, 0x4f, 0xdb, 0x8e, 0x63, 0x3f, 0x27, 0xd9, 0x9e, 0x9a, 0xcd, 0x8c, 0xd7, 0x3b, 0xcc, 0x84,
-	0xd6, 0x32, 0x1a, 0xc2, 0xae, 0x23, 0x25, 0x5a, 0xc4, 0x42, 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xc9, 0xc2, 0xc8, 0x71, 0x1a, 0x71, 0x45, 0xc9, 0x09, 0x60,
-	0x74, 0x79, 0x38, 0x51, 0x84, 0xfc, 0xd6, 0xfb, 0xc6, 0xe8, 0x2d, 0x94, 0x8a, 0x12, 0x92, 0x14,
-	0x7b, 0x89, 0xac, 0x41, 0xb9, 0x15, 0xa8, 0xa5, 0xb5, 0xdf, 0x7e, 0xf1, 0x8f, 0xfb, 0x4b, 0x5f,
-	0xbd, 0xbc, 0x6f, 0xbd, 0x78, 0x79, 0xdf, 0xfa, 0xfb, 0xcb, 0xfb, 0xd6, 0x4f, 0x77, 0xb5, 0xbf,
-	0xc8, 0x63, 0xca, 0x23, 0xff, 0x32, 0x8c, 0xfc, 0x81, 0x1f, 0xa8, 0x45, 0xc0, 0xb6, 0x27, 0xe7,
-	0x83, 0xed, 0xc9, 0xe9, 0x76, 0x56, 0xc0, 0xa7, 0x45, 0xfc, 0x85, 0xbc, 0xfb, 0xdf, 0x00, 0x00,
-	0x00, 0xff, 0xff, 0x92, 0xab, 0x29, 0xe1, 0xa1, 0x16, 0x00, 0x00,
+	// 2013 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6f, 0x23, 0x49,
+	0x15, 0x4f, 0xdb, 0x8e, 0x3f, 0x9e, 0x93, 0x4c, 0x4f, 0xcd, 0x64, 0xc6, 0x9b, 0x1d, 0x66, 0x42,
+	0xb3, 0x8c, 0x86, 0xb0, 0x9b, 0x48, 0x89, 0x16, 0xb1, 0x90, 0xdd, 0x91, 0x63, 0x7b, 0x67, 0xb2,
+	0x24, 0xce, 0xa8, 0xed, 0xa0, 0x15, 0x68, 0x35, 0xea, 0xb8, 0x2b, 0x76, 0x13, 0xbb, 0xcb, 0x74,
+	0x97, 0x43, 0xb2, 0x37, 0x0e, 0x70, 0x03, 0x09, 0x89, 0x03, 0x42, 0xfb, 0x67,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b, 0xa7, 0x5e, 0x20, 0x02, 0x9c, 0xd7, 0xcf, 0x74, 0x27, 0x61, 0x28,
+	0x14, 0x17, 0x36, 0x3e, 0x07, 0x7b, 0xfa, 0x1d, 0x22, 0x3c, 0xad, 0xfb, 0xbe, 0xbc, 0x72, 0xed,
+	0x05, 0x11, 0x39, 0x97, 0x8e, 0xd8, 0x39, 0x55, 0x24, 0x0b, 0x23, 0xc7, 0xbd, 0x88, 0x2b, 0x4a,
+	0x4e, 0x00, 0xa3, 0xc3, 0xd9, 0x58, 0x11, 0xf2, 0x1b, 0xef, 0x1b, 0x13, 0xb7, 0x50, 0x2a, 0x2a,
+	0x27, 0xa1, 0xd8, 0x0b, 0x64, 0x19, 0x2a, 0xcd, 0x50, 0x2d, 0xad, 0xbd, 0xd6, 0x8b, 0xbf, 0xdf,
+	0x5f, 0xf8, 0xfa, 0xe5, 0x7d, 0xeb, 0xc5, 0xcb, 0xfb, 0xd6, 0xdf, 0x5e, 0xde, 0xb7, 0x7e, 0xb6,
+	0xa3, 0xfd, 0x16, 0x1f, 0x79, 0x3c, 0x0a, 0x2e, 0x58, 0x14, 0xf4, 0x83, 0x50, 0x2d, 0x42, 0xba,
+	0x35, 0x3e, 0xeb, 0x6f, 0x8d, 0x4f, 0xb6, 0xb2, 0xba, 0x3d, 0x29, 0xe2, 0x3f, 0xf1, 0x9d, 0xff,
+	0x06, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x99, 0xe6, 0xb4, 0x72, 0x17, 0x00, 0x00,
 }
 
 func (m *LogShardInfo) Marshal() (dAtA []byte, err error) {
@@ -2457,22 +2578,27 @@ func (m *RSMState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 			dAtA[i] = 0x8
 			i = encodeVarintLogservice(dAtA, i, uint64(baseI-i))
 			i--
-			dAtA[i] = 0x22
+			dAtA[i] = 0x2a
 		}
 	}
 	if m.TruncatedIndex != 0 {
 		i = encodeVarintLogservice(dAtA, i, uint64(m.TruncatedIndex))
 		i--
-		dAtA[i] = 0x18
+		dAtA[i] = 0x20
 	}
 	if m.LeaseHolderID != 0 {
 		i = encodeVarintLogservice(dAtA, i, uint64(m.LeaseHolderID))
 		i--
-		dAtA[i] = 0x10
+		dAtA[i] = 0x18
 	}
 	if m.Index != 0 {
 		i = encodeVarintLogservice(dAtA, i, uint64(m.Index))
 		i--
+		dAtA[i] = 0x10
+	}
+	if m.Tso != 0 {
+		i = encodeVarintLogservice(dAtA, i, uint64(m.Tso))
+		i--
 		dAtA[i] = 0x8
 	}
 	return len(dAtA) - i, nil
@@ -2581,6 +2707,38 @@ func (m *LogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 	return len(dAtA) - i, nil
 }
 
+func (m *TsoRequest) 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 *TsoRequest) MarshalTo(dAtA []byte) (int, error) {
+	size := m.Size()
+	return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *TsoRequest) 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.Count != 0 {
+		i = encodeVarintLogservice(dAtA, i, uint64(m.Count))
+		i--
+		dAtA[i] = 0x8
+	}
+	return len(dAtA) - i, nil
+}
+
 func (m *Request) Marshal() (dAtA []byte, err error) {
 	size := m.Size()
 	dAtA = make([]byte, size)
@@ -2605,6 +2763,16 @@ func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 		i -= len(m.XXX_unrecognized)
 		copy(dAtA[i:], m.XXX_unrecognized)
 	}
+	{
+		size, err := m.TsoRequest.MarshalToSizedBuffer(dAtA[:i])
+		if err != nil {
+			return 0, err
+		}
+		i -= size
+		i = encodeVarintLogservice(dAtA, i, uint64(size))
+	}
+	i--
+	dAtA[i] = 0x3a
 	{
 		size, err := m.DNHeartbeat.MarshalToSizedBuffer(dAtA[:i])
 		if err != nil {
@@ -2719,6 +2887,16 @@ func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 		i -= len(m.XXX_unrecognized)
 		copy(dAtA[i:], m.XXX_unrecognized)
 	}
+	{
+		size, err := m.TsoResponse.MarshalToSizedBuffer(dAtA[:i])
+		if err != nil {
+			return 0, err
+		}
+		i -= size
+		i = encodeVarintLogservice(dAtA, i, uint64(size))
+	}
+	i--
+	dAtA[i] = 0x3a
 	{
 		size, err := m.CommandBatch.MarshalToSizedBuffer(dAtA[:i])
 		if err != nil {
@@ -2805,6 +2983,38 @@ func (m *LogRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 	return len(dAtA) - i, nil
 }
 
+func (m *TsoResponse) 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 *TsoResponse) MarshalTo(dAtA []byte) (int, error) {
+	size := m.Size()
+	return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *TsoResponse) 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.Value != 0 {
+		i = encodeVarintLogservice(dAtA, i, uint64(m.Value))
+		i--
+		dAtA[i] = 0x8
+	}
+	return len(dAtA) - i, nil
+}
+
 func (m *Replica) Marshal() (dAtA []byte, err error) {
 	size := m.Size()
 	dAtA = make([]byte, size)
@@ -3725,6 +3935,9 @@ func (m *RSMState) Size() (n int) {
 	}
 	var l int
 	_ = l
+	if m.Tso != 0 {
+		n += 1 + sovLogservice(uint64(m.Tso))
+	}
 	if m.Index != 0 {
 		n += 1 + sovLogservice(uint64(m.Index))
 	}
@@ -3801,6 +4014,21 @@ func (m *LogRequest) Size() (n int) {
 	return n
 }
 
+func (m *TsoRequest) Size() (n int) {
+	if m == nil {
+		return 0
+	}
+	var l int
+	_ = l
+	if m.Count != 0 {
+		n += 1 + sovLogservice(uint64(m.Count))
+	}
+	if m.XXX_unrecognized != nil {
+		n += len(m.XXX_unrecognized)
+	}
+	return n
+}
+
 func (m *Request) Size() (n int) {
 	if m == nil {
 		return 0
@@ -3822,6 +4050,8 @@ func (m *Request) Size() (n int) {
 	n += 1 + l + sovLogservice(uint64(l))
 	l = m.DNHeartbeat.Size()
 	n += 1 + l + sovLogservice(uint64(l))
+	l = m.TsoRequest.Size()
+	n += 1 + l + sovLogservice(uint64(l))
 	if m.XXX_unrecognized != nil {
 		n += len(m.XXX_unrecognized)
 	}
@@ -3872,6 +4102,8 @@ func (m *Response) Size() (n int) {
 	n += 1 + l + sovLogservice(uint64(l))
 	l = m.CommandBatch.Size()
 	n += 1 + l + sovLogservice(uint64(l))
+	l = m.TsoResponse.Size()
+	n += 1 + l + sovLogservice(uint64(l))
 	if m.XXX_unrecognized != nil {
 		n += len(m.XXX_unrecognized)
 	}
@@ -3896,6 +4128,21 @@ func (m *LogRecordResponse) Size() (n int) {
 	return n
 }
 
+func (m *TsoResponse) Size() (n int) {
+	if m == nil {
+		return 0
+	}
+	var l int
+	_ = l
+	if m.Value != 0 {
+		n += 1 + sovLogservice(uint64(m.Value))
+	}
+	if m.XXX_unrecognized != nil {
+		n += len(m.XXX_unrecognized)
+	}
+	return n
+}
+
 func (m *Replica) Size() (n int) {
 	if m == nil {
 		return 0
@@ -5032,6 +5279,25 @@ func (m *RSMState) Unmarshal(dAtA []byte) error {
 		}
 		switch fieldNum {
 		case 1:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field Tso", wireType)
+			}
+			m.Tso = 0
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLogservice
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				m.Tso |= uint64(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+		case 2:
 			if wireType != 0 {
 				return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
 			}
@@ -5050,7 +5316,7 @@ func (m *RSMState) Unmarshal(dAtA []byte) error {
 					break
 				}
 			}
-		case 2:
+		case 3:
 			if wireType != 0 {
 				return fmt.Errorf("proto: wrong wireType = %d for field LeaseHolderID", wireType)
 			}
@@ -5069,7 +5335,7 @@ func (m *RSMState) Unmarshal(dAtA []byte) error {
 					break
 				}
 			}
-		case 3:
+		case 4:
 			if wireType != 0 {
 				return fmt.Errorf("proto: wrong wireType = %d for field TruncatedIndex", wireType)
 			}
@@ -5088,7 +5354,7 @@ func (m *RSMState) Unmarshal(dAtA []byte) error {
 					break
 				}
 			}
-		case 4:
+		case 5:
 			if wireType != 2 {
 				return fmt.Errorf("proto: wrong wireType = %d for field LeaseHistory", wireType)
 			}
@@ -5510,6 +5776,76 @@ func (m *LogRequest) Unmarshal(dAtA []byte) error {
 	}
 	return nil
 }
+func (m *TsoRequest) 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 ErrIntOverflowLogservice
+			}
+			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: TsoRequest: wiretype end group for non-group")
+		}
+		if fieldNum <= 0 {
+			return fmt.Errorf("proto: TsoRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+		}
+		switch fieldNum {
+		case 1:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
+			}
+			m.Count = 0
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLogservice
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				m.Count |= uint64(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+		default:
+			iNdEx = preIndex
+			skippy, err := skipLogservice(dAtA[iNdEx:])
+			if err != nil {
+				return err
+			}
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			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 *Request) Unmarshal(dAtA []byte) error {
 	l := len(dAtA)
 	iNdEx := 0
@@ -5695,6 +6031,39 @@ func (m *Request) Unmarshal(dAtA []byte) error {
 				return err
 			}
 			iNdEx = postIndex
+		case 7:
+			if wireType != 2 {
+				return fmt.Errorf("proto: wrong wireType = %d for field TsoRequest", wireType)
+			}
+			var msglen int
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLogservice
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				msglen |= int(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+			if msglen < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			postIndex := iNdEx + msglen
+			if postIndex < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			if postIndex > l {
+				return io.ErrUnexpectedEOF
+			}
+			if err := m.TsoRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+				return err
+			}
+			iNdEx = postIndex
 		default:
 			iNdEx = preIndex
 			skippy, err := skipLogservice(dAtA[iNdEx:])
@@ -6009,6 +6378,39 @@ func (m *Response) Unmarshal(dAtA []byte) error {
 				return err
 			}
 			iNdEx = postIndex
+		case 7:
+			if wireType != 2 {
+				return fmt.Errorf("proto: wrong wireType = %d for field TsoResponse", wireType)
+			}
+			var msglen int
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLogservice
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				msglen |= int(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+			if msglen < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			postIndex := iNdEx + msglen
+			if postIndex < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			if postIndex > l {
+				return io.ErrUnexpectedEOF
+			}
+			if err := m.TsoResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+				return err
+			}
+			iNdEx = postIndex
 		default:
 			iNdEx = preIndex
 			skippy, err := skipLogservice(dAtA[iNdEx:])
@@ -6116,6 +6518,76 @@ func (m *LogRecordResponse) Unmarshal(dAtA []byte) error {
 	}
 	return nil
 }
+func (m *TsoResponse) 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 ErrIntOverflowLogservice
+			}
+			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: TsoResponse: wiretype end group for non-group")
+		}
+		if fieldNum <= 0 {
+			return fmt.Errorf("proto: TsoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+		}
+		switch fieldNum {
+		case 1:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
+			}
+			m.Value = 0
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLogservice
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				m.Value |= uint64(b&0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
+		default:
+			iNdEx = preIndex
+			skippy, err := skipLogservice(dAtA[iNdEx:])
+			if err != nil {
+				return err
+			}
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
+				return ErrInvalidLengthLogservice
+			}
+			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 *Replica) Unmarshal(dAtA []byte) error {
 	l := len(dAtA)
 	iNdEx := 0
diff --git a/proto/logservice.proto b/proto/logservice.proto
index c5fac2113..af003709e 100644
--- a/proto/logservice.proto
+++ b/proto/logservice.proto
@@ -85,23 +85,23 @@ message DNStoreHeartbeat {
 };
 
 message RSMState {
-  uint64 Index = 1;
-  uint64 LeaseHolderID = 2;
-  uint64 TruncatedIndex = 3;
-  map<uint64, uint64> LeaseHistory = 4; // log index -> truncate index
+  uint64 Tso = 1;
+  uint64 Index = 2;
+  uint64 LeaseHolderID = 3;
+  uint64 TruncatedIndex = 4;
+  map<uint64, uint64> LeaseHistory = 5; // log index -> truncate index
 }
 
 enum MethodType {
-  CREATE       = 0;
-  DESTROY      = 1;
-  APPEND       = 2;
-  READ         = 3;
-  TRUNCATE     = 4;
-  GET_TRUNCATE = 5;
-  CONNECT      = 6;
-  CONNECT_RO   = 7;
-  LOG_HEARTBEAT = 8;
-  DN_HEARTBEAT  = 9;
+  TSO_UPDATE    = 0;
+  APPEND        = 1;
+  READ          = 2;
+  TRUNCATE      = 3;
+  GET_TRUNCATE  = 4;
+  CONNECT       = 5;
+  CONNECT_RO    = 6;
+  LOG_HEARTBEAT = 7;
+  DN_HEARTBEAT  = 8;
 };
 
 enum RecordType {
@@ -127,13 +127,18 @@ message LogRequest {
   uint64 DNID         = 6;
 }
 
+message TsoRequest {
+  uint64 Count        = 1;
+}
+
 message Request {
   uint64 RequestID               = 1;
   MethodType Method              = 2;
   int64 Timeout                  = 3;
   LogRequest LogRequest          = 4 [(gogoproto.nullable) = false];
   LogStoreHeartbeat LogHeartbeat = 5 [(gogoproto.nullable) = false];
-  DNStoreHeartbeat DNHeartbeat   = 6 [(gogoproto.nullable) = false]; 
+  DNStoreHeartbeat DNHeartbeat   = 6 [(gogoproto.nullable) = false];
+  TsoRequest TsoRequest          = 7 [(gogoproto.nullable) = false];
 };
 
 enum ErrorCode {
@@ -168,12 +173,16 @@ message Response {
   string ErrorMessage     = 4;
   LogResponse LogResponse = 5 [(gogoproto.nullable) = false];
   CommandBatch CommandBatch = 6 [(gogoproto.nullable) = false];
+  TsoResponse TsoResponse = 7 [(gogoproto.nullable) = false];
 };
 
 message LogRecordResponse {
   repeated LogRecord Records = 1 [(gogoproto.nullable) = false];
 };
 
+message TsoResponse {
+  uint64 Value = 1;
+}
 
 //
 // HAKeeper related pb


Test patch:
diff --git a/pkg/logservice/client_test.go b/pkg/logservice/client_test.go
index 17444e2a6..4e606b86f 100644
--- a/pkg/logservice/client_test.go
+++ b/pkg/logservice/client_test.go
@@ -69,6 +69,25 @@ func TestClientCanBeCreated(t *testing.T) {
 	runClientTest(t, true, fn)
 }
 
+func TestClientGetTSOTimestamp(t *testing.T) {
+	fn := func(t *testing.T, cfg ClientConfig, c Client) {
+		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+		defer cancel()
+		v, err := c.GetTSOTimestamp(ctx, 100)
+		require.NoError(t, err)
+		assert.Equal(t, uint64(1), v)
+
+		v, err = c.GetTSOTimestamp(ctx, 1000)
+		require.NoError(t, err)
+		assert.Equal(t, uint64(101), v)
+
+		v, err = c.GetTSOTimestamp(ctx, 100)
+		require.NoError(t, err)
+		assert.Equal(t, uint64(1101), v)
+	}
+	runClientTest(t, false, fn)
+}
+
 func TestClientAppend(t *testing.T) {
 	fn := func(t *testing.T, cfg ClientConfig, c Client) {
 		cmd := make([]byte, 16+headerSize+8)
diff --git a/pkg/logservice/rsm_test.go b/pkg/logservice/rsm_test.go
index d3f8ce9d3..5cb6102d8 100644
--- a/pkg/logservice/rsm_test.go
+++ b/pkg/logservice/rsm_test.go
@@ -190,6 +190,16 @@ func TestStateMachineUserUpdate(t *testing.T) {
 	assert.Equal(t, tsm.state.LeaseHolderID, binaryEnc.Uint64(result.Data))
 }
 
+func TestTsoUpdate(t *testing.T) {
+	tsm := newStateMachine(1, 2).(*stateMachine)
+	tsm.state.Tso = 200
+	cmd := getTsoUpdateCmd(100)
+	result, err := tsm.Update(sm.Entry{Cmd: cmd})
+	assert.NoError(t, err)
+	assert.Equal(t, uint64(200), result.Value)
+	assert.Equal(t, uint64(300), tsm.state.Tso)
+}
+
 func TestStateMachineSnapshot(t *testing.T) {
 	buf := bytes.NewBuffer(nil)
 	tsm := newStateMachine(1, 2).(*stateMachine)
diff --git a/pkg/logservice/service_test.go b/pkg/logservice/service_test.go
index 91bc9ae07..e259fd3d0 100644
--- a/pkg/logservice/service_test.go
+++ b/pkg/logservice/service_test.go
@@ -397,6 +397,34 @@ func TestServiceTruncate(t *testing.T) {
 	runServiceTest(t, false, fn)
 }
 
+func TestServiceTsoUpdate(t *testing.T) {
+	fn := func(t *testing.T, s *Service) {
+		req := pb.Request{
+			Method:  pb.TSO_UPDATE,
+			Timeout: int64(time.Second),
+			TsoRequest: pb.TsoRequest{
+				Count: 100,
+			},
+		}
+		resp := s.handleTsoUpdate(req)
+		assert.Equal(t, pb.NoError, resp.ErrorCode)
+		assert.Equal(t, "", resp.ErrorMessage)
+		assert.Equal(t, uint64(1), resp.TsoResponse.Value)
+
+		req.TsoRequest.Count = 1000
+		resp = s.handleTsoUpdate(req)
+		assert.Equal(t, pb.NoError, resp.ErrorCode)
+		assert.Equal(t, "", resp.ErrorMessage)
+		assert.Equal(t, uint64(101), resp.TsoResponse.Value)
+
+		resp = s.handleTsoUpdate(req)
+		assert.Equal(t, pb.NoError, resp.ErrorCode)
+		assert.Equal(t, "", resp.ErrorMessage)
+		assert.Equal(t, uint64(1101), resp.TsoResponse.Value)
+	}
+	runServiceTest(t, false, fn)
+}
+
 func TestShardInfoCanBeQueried(t *testing.T) {
 	defer leaktest.AfterTest(t)()
 	cfg1 := Config{
diff --git a/pkg/logservice/store_test.go b/pkg/logservice/store_test.go
index 0f98faadf..4bc81bd53 100644
--- a/pkg/logservice/store_test.go
+++ b/pkg/logservice/store_test.go
@@ -187,6 +187,20 @@ func TestAppendLogIsRejectedForMismatchedLeaseHolderID(t *testing.T) {
 	runStoreTest(t, fn)
 }
 
+func TestStoreTsoUpdate(t *testing.T) {
+	fn := func(t *testing.T, store *store) {
+		ctx, cancel := context.WithTimeout(context.Background(), testIOTimeout)
+		defer cancel()
+		v1, err := store.TsoUpdate(ctx, 100)
+		require.NoError(t, err)
+		assert.Equal(t, uint64(1), v1)
+		v2, err := store.TsoUpdate(ctx, 1000)
+		require.NoError(t, err)
+		assert.Equal(t, uint64(101), v2)
+	}
+	runStoreTest(t, fn)
+}
+
 func TestTruncateLog(t *testing.T) {
 	fn := func(t *testing.T, store *store) {
 		ctx, cancel := context.WithTimeout(context.Background(), testIOTimeout)