Repository: matrixorigin/matrixone
Pull request #3683 (2022-07-03 15:37:24)

hakeeper,logservice: support heartbeats to be sent to hakeeper
**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:**

support heartbeats to be sent to hakeeper. 

**Special notes for your reviewer:**

Not Available

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

Not Available



Patch:
diff --git a/pkg/hakeeper/rsm.go b/pkg/hakeeper/rsm.go
index 3e5d5db96..6bb5f90f9 100644
--- a/pkg/hakeeper/rsm.go
+++ b/pkg/hakeeper/rsm.go
@@ -58,6 +58,7 @@ const (
 type StateQuery struct{}
 type logShardIDQuery struct{ name string }
 type logShardIDQueryResult struct{ id uint64 }
+type ScheduleCommandQuery struct{ UUID string }
 
 type stateMachine struct {
 	replicaID uint64
@@ -298,11 +299,20 @@ func (s *stateMachine) handleShardIDQuery(name string) *logShardIDQueryResult {
 	return &logShardIDQueryResult{}
 }
 
+func (s *stateMachine) handleScheduleCommandQuery(uuid string) *pb.CommandBatch {
+	if batch, ok := s.state.ScheduleCommands[uuid]; ok {
+		return &batch
+	}
+	return &pb.CommandBatch{}
+}
+
 func (s *stateMachine) Lookup(query interface{}) (interface{}, error) {
 	if q, ok := query.(*logShardIDQuery); ok {
 		return s.handleShardIDQuery(q.name), nil
 	} else if _, ok := query.(*StateQuery); ok {
 		return s.handleStateQuery(), nil
+	} else if q, ok := query.(*ScheduleCommandQuery); ok {
+		return s.handleScheduleCommandQuery(q.UUID), nil
 	}
 	panic("unknown query type")
 }
diff --git a/pkg/logservice/hachecker.go b/pkg/logservice/hachecker.go
index 3496d7c64..eb8d1859b 100644
--- a/pkg/logservice/hachecker.go
+++ b/pkg/logservice/hachecker.go
@@ -104,16 +104,7 @@ func (l *store) healthCheck() {
 		cmds := l.checker.Check(l.alloc,
 			state.ClusterInfo, state.DNState, state.LogState, state.Tick)
 		if len(cmds) > 0 {
-			ctx2, cancel2 := context.WithTimeout(context.Background(),
-				hakeeperCmdUploadTimeout)
-			defer cancel2()
-			b := &pb.CommandBatch{
-				Term:     term,
-				Commands: cmds,
-			}
-			data := MustMarshal(b)
-			session := l.nh.GetNoOPSession(hakeeper.DefaultHAKeeperShardID)
-			if _, err := l.propose(ctx2, session, data); err != nil {
+			if err := l.addScheduleCommands(ctx, term, cmds); err != nil {
 				// TODO: check whether this is temp error
 				return
 			}
diff --git a/pkg/logservice/service.go b/pkg/logservice/service.go
index 79cb619c7..ada2406bc 100644
--- a/pkg/logservice/service.go
+++ b/pkg/logservice/service.go
@@ -236,6 +236,10 @@ func (s *Service) handle(req pb.Request,
 		return s.handleConnect(req), pb.LogRecordResponse{}
 	case pb.CONNECT_RO:
 		return s.handleConnectRO(req), pb.LogRecordResponse{}
+	case pb.LOG_HEARTBEAT:
+		return s.handleLogHeartbeat(req), pb.LogRecordResponse{}
+	case pb.DN_HEARTBEAT:
+		return s.handleDNHeartbeat(req), pb.LogRecordResponse{}
 	default:
 		panic("unknown method type")
 	}
@@ -320,3 +324,42 @@ func (s *Service) handleGetTruncatedIndex(req pb.Request) pb.Response {
 	}
 	return resp
 }
+
+// TODO: add tests to see what happens when request is sent to non hakeeper stores
+func (s *Service) handleLogHeartbeat(req pb.Request) pb.Response {
+	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(req.Timeout))
+	defer cancel()
+	hb := req.LogHeartbeat
+	resp := getResponse(req)
+	if err := s.store.AddLogStoreHeartbeat(ctx, hb); err != nil {
+		resp.ErrorCode, resp.ErrorMessage = toErrorCode(err)
+		return resp
+	}
+	if cb, err := s.store.GetCommandBatch(ctx, hb.UUID); err != nil {
+		resp.ErrorCode, resp.ErrorMessage = toErrorCode(err)
+		return resp
+	} else {
+		resp.CommandBatch = cb
+	}
+
+	return resp
+}
+
+func (s *Service) handleDNHeartbeat(req pb.Request) pb.Response {
+	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(req.Timeout))
+	defer cancel()
+	hb := req.DNHeartbeat
+	resp := getResponse(req)
+	if err := s.store.AddDNStoreHeartbeat(ctx, hb); err != nil {
+		resp.ErrorCode, resp.ErrorMessage = toErrorCode(err)
+		return resp
+	}
+	if cb, err := s.store.GetCommandBatch(ctx, hb.UUID); err != nil {
+		resp.ErrorCode, resp.ErrorMessage = toErrorCode(err)
+		return resp
+	} else {
+		resp.CommandBatch = cb
+	}
+
+	return resp
+}
diff --git a/pkg/logservice/store.go b/pkg/logservice/store.go
index 4f6a66ea1..d6240d850 100644
--- a/pkg/logservice/store.go
+++ b/pkg/logservice/store.go
@@ -344,6 +344,27 @@ func (l *store) AddDNStoreHeartbeat(ctx context.Context,
 	return nil
 }
 
+func (l *store) GetCommandBatch(ctx context.Context,
+	uuid string) (pb.CommandBatch, error) {
+	v, err := l.read(ctx,
+		hakeeper.DefaultHAKeeperShardID, &hakeeper.ScheduleCommandQuery{UUID: uuid})
+	if err != nil {
+		return pb.CommandBatch{}, err
+	}
+	return *(v.(*pb.CommandBatch)), nil
+}
+
+func (l *store) addScheduleCommands(ctx context.Context,
+	term uint64, cmds []pb.ScheduleCommand) error {
+	cmd := hakeeper.GetUpdateCommandsCmd(term, cmds)
+	session := l.nh.GetNoOPSession(hakeeper.DefaultHAKeeperShardID)
+	if _, err := l.propose(ctx, session, cmd); err != nil {
+		return err
+	}
+
+	return nil
+}
+
 func (l *store) getLeaseHolderID(ctx context.Context,
 	shardID uint64, entries []raftpb.Entry) (uint64, error) {
 	if len(entries) == 0 {
diff --git a/pkg/pb/logservice/logservice.pb.go b/pkg/pb/logservice/logservice.pb.go
index 971c7732e..24d2ee8ee 100644
--- a/pkg/pb/logservice/logservice.pb.go
+++ b/pkg/pb/logservice/logservice.pb.go
@@ -940,14 +940,15 @@ func (m *LogResponse) GetLastIndex() uint64 {
 }
 
 type Response 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"`
-	ErrorCode            ErrorCode   `protobuf:"varint,3,opt,name=ErrorCode,proto3,enum=logservice.ErrorCode" json:"ErrorCode,omitempty"`
-	ErrorMessage         string      `protobuf:"bytes,4,opt,name=ErrorMessage,proto3" json:"ErrorMessage,omitempty"`
-	LogResponse          LogResponse `protobuf:"bytes,5,opt,name=LogResponse,proto3" json:"LogResponse"`
-	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
-	XXX_unrecognized     []byte      `json:"-"`
-	XXX_sizecache        int32       `json:"-"`
+	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"`
+	ErrorCode            ErrorCode    `protobuf:"varint,3,opt,name=ErrorCode,proto3,enum=logservice.ErrorCode" json:"ErrorCode,omitempty"`
+	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"`
+	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
+	XXX_unrecognized     []byte       `json:"-"`
+	XXX_sizecache        int32        `json:"-"`
 }
 
 func (m *Response) Reset()         { *m = Response{} }
@@ -1018,6 +1019,13 @@ func (m *Response) GetLogResponse() LogResponse {
 	return LogResponse{}
 }
 
+func (m *Response) GetCommandBatch() CommandBatch {
+	if m != nil {
+		return m.CommandBatch
+	}
+	return CommandBatch{}
+}
+
 type LogRecordResponse struct {
 	Records              []LogRecord `protobuf:"bytes,1,rep,name=Records,proto3" json:"Records"`
 	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
@@ -1905,119 +1913,120 @@ func init() {
 func init() { proto.RegisterFile("logservice.proto", fileDescriptor_fd1040c5381ab5a7) }
 
 var fileDescriptor_fd1040c5381ab5a7 = []byte{
-	// 1781 bytes of a gzipped FileDescriptorProto
+	// 1796 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, 0xda, 0xcd, 0x8c, 0xd7, 0x0c, 0x33, 0x51,
 	0x0b, 0xad, 0x86, 0xb0, 0xeb, 0x48, 0x89, 0x16, 0xb1, 0x90, 0xdd, 0x91, 0x63, 0x9b, 0x99, 0x2c,
-	0x89, 0x33, 0x6a, 0x3b, 0xd2, 0x02, 0x5a, 0x8d, 0x2a, 0xee, 0x8a, 0xdd, 0xc4, 0xee, 0x36, 0xdd,
-	0xe5, 0x30, 0xe1, 0x03, 0x70, 0xe4, 0x03, 0xa0, 0xe5, 0x5b, 0x70, 0xe6, 0xbc, 0x27, 0x14, 0x0e,
-	0x5c, 0x17, 0x98, 0x13, 0x37, 0x24, 0xae, 0x5c, 0x50, 0xbd, 0xea, 0xea, 0xae, 0xea, 0x38, 0x99,
-	0x3f, 0xe2, 0xb2, 0xb7, 0xae, 0x57, 0xef, 0xbd, 0x7a, 0x7f, 0x7e, 0xef, 0xd5, 0xab, 0x06, 0x7b,
-	0x12, 0x8e, 0x62, 0x16, 0x5d, 0xf8, 0x43, 0xd6, 0x9c, 0x45, 0x21, 0x0f, 0x09, 0x64, 0x94, 0xc6,
-	0x47, 0x23, 0x9f, 0x8f, 0xe7, 0xa7, 0xcd, 0x61, 0x38, 0xdd, 0x1e, 0x85, 0xa3, 0x70, 0x1b, 0x59,
-	0x4e, 0xe7, 0x67, 0xb8, 0xc2, 0x05, 0x7e, 0x49, 0xd1, 0xc6, 0xfa, 0x94, 0x71, 0xea, 0x51, 0x4e,
-	0xe5, 0x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c7, 0x7c, 0xc8, 0x62, 0xa9, 0x55, 0x3a, 0xfd, 0xef, 0x95, 0xad, 0x2f, 0xc0, 0x9d, 0x1f, 0x6d,
+	0x85, 0xba, 0x46, 0x10, 0xa8, 0xfb, 0xc7, 0x5d, 0x12, 0xe6, 0xf9, 0x6c, 0x12, 0x5d, 0x30, 0x4d,
+	0x72, 0xd0, 0x3c, 0x4e, 0x63, 0xae, 0x29, 0x39, 0x11, 0xfd, 0x2e, 0x8f, 0xa6, 0x9a, 0x90, 0xdf,
+	0xfa, 0xd0, 0x1a, 0xf5, 0x84, 0x52, 0x81, 0x53, 0x49, 0x71, 0x97, 0xc8, 0x1a, 0x94, 0x5b, 0xa1,
+	0x5e, 0x3a, 0xfb, 0xed, 0xab, 0x7f, 0x3d, 0x58, 0xfa, 0xfa, 0xe5, 0x03, 0xe7, 0xea, 0xe5, 0x03,
+	0xe7, 0x9f, 0x2f, 0x1f, 0x38, 0xbf, 0xd8, 0x35, 0xfe, 0x47, 0x4e, 0x28, 0x8f, 0x47, 0x2f, 0xa2,
+	0x78, 0x34, 0x18, 0x85, 0x7a, 0x11, 0xb2, 0xed, 0xe9, 0xf9, 0x60, 0x7b, 0x7a, 0xba, 0x9d, 0x55,
+	0xc9, 0x69, 0x11, 0x7f, 0x46, 0xee, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x45, 0xb6, 0x2d, 0xca,
+	0xeb, 0x14, 0x00, 0x00,
 }
 
 func (m *LogShardInfo) Marshal() (dAtA []byte, err error) {
@@ -2578,6 +2587,16 @@ func (m *Response) MarshalToSizedBuffer(dAtA []byte) (int, error) {
 		i -= len(m.XXX_unrecognized)
 		copy(dAtA[i:], m.XXX_unrecognized)
 	}
+	{
+		size, err := m.CommandBatch.MarshalToSizedBuffer(dAtA[:i])
+		if err != nil {
+			return 0, err
+		}
+		i -= size
+		i = encodeVarintLogservice(dAtA, i, uint64(size))
+	}
+	i--
+	dAtA[i] = 0x32
 	{
 		size, err := m.LogResponse.MarshalToSizedBuffer(dAtA[:i])
 		if err != nil {
@@ -3657,6 +3676,8 @@ func (m *Response) Size() (n int) {
 	}
 	l = m.LogResponse.Size()
 	n += 1 + l + sovLogservice(uint64(l))
+	l = m.CommandBatch.Size()
+	n += 1 + l + sovLogservice(uint64(l))
 	if m.XXX_unrecognized != nil {
 		n += len(m.XXX_unrecognized)
 	}
@@ -5731,6 +5752,39 @@ func (m *Response) Unmarshal(dAtA []byte) error {
 				return err
 			}
 			iNdEx = postIndex
+		case 6:
+			if wireType != 2 {
+				return fmt.Errorf("proto: wrong wireType = %d for field CommandBatch", 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.CommandBatch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+				return err
+			}
+			iNdEx = postIndex
 		default:
 			iNdEx = preIndex
 			skippy, err := skipLogservice(dAtA[iNdEx:])
diff --git a/proto/logservice.proto b/proto/logservice.proto
index cdd8ae5c8..decda0581 100644
--- a/proto/logservice.proto
+++ b/proto/logservice.proto
@@ -167,6 +167,7 @@ message Response {
   ErrorCode ErrorCode     = 3;
   string ErrorMessage     = 4;
   LogResponse LogResponse = 5 [(gogoproto.nullable) = false];
+  CommandBatch CommandBatch = 6 [(gogoproto.nullable) = false];
 };
 
 message LogRecordResponse {
@@ -289,8 +290,7 @@ message HAKeeperRSMState {
     uint64 Tick                                = 1;
     uint64 NextID                              = 2;
     uint64 Term                                = 3;
-    map<string, CommandBatch> ScheduleCommands = 4
-        [(gogoproto.nullable) = false];
+    map<string, CommandBatch> ScheduleCommands = 4 [(gogoproto.nullable) = false];
     map<string, uint64> LogShards = 5;
     DNState DNState               = 6 [(gogoproto.nullable) = false];
     LogState LogState             = 7 [(gogoproto.nullable) = false];


Test patch:
diff --git a/pkg/hakeeper/rsm_test.go b/pkg/hakeeper/rsm_test.go
index 74a426ece..4464582c5 100644
--- a/pkg/hakeeper/rsm_test.go
+++ b/pkg/hakeeper/rsm_test.go
@@ -295,3 +295,47 @@ func TestUpdateScheduleCommandsCmd(t *testing.T) {
 	assert.True(t, ok)
 	assert.Equal(t, pb.CommandBatch{Commands: []pb.ScheduleCommand{sc2}}, l2)
 }
+
+func TestScheduleCommandQuery(t *testing.T) {
+	tsm1 := NewStateMachine(0, 1).(*stateMachine)
+	sc1 := pb.ScheduleCommand{
+		UUID: "uuid1",
+		ConfigChange: &pb.ConfigChange{
+			Replica: pb.Replica{
+				ShardID: 1,
+			},
+		},
+	}
+	sc2 := pb.ScheduleCommand{
+		UUID: "uuid2",
+		ConfigChange: &pb.ConfigChange{
+			Replica: pb.Replica{
+				ShardID: 2,
+			},
+		},
+	}
+	sc3 := pb.ScheduleCommand{
+		UUID: "uuid1",
+		ConfigChange: &pb.ConfigChange{
+			Replica: pb.Replica{
+				ShardID: 3,
+			},
+		},
+	}
+	b := pb.CommandBatch{
+		Term:     101,
+		Commands: []pb.ScheduleCommand{sc1, sc2, sc3},
+	}
+	cmd := GetUpdateCommandsCmd(b.Term, b.Commands)
+	_, err := tsm1.Update(sm.Entry{Cmd: cmd})
+	require.NoError(t, err)
+	r, err := tsm1.Lookup(&ScheduleCommandQuery{UUID: "uuid1"})
+	require.NoError(t, err)
+	cb, ok := r.(*pb.CommandBatch)
+	require.True(t, ok)
+	assert.Equal(t, 2, len(cb.Commands))
+	b = pb.CommandBatch{
+		Commands: []pb.ScheduleCommand{sc1, sc3},
+	}
+	assert.Equal(t, b, *cb)
+}
diff --git a/pkg/logservice/commands_test.go b/pkg/logservice/commands_test.go
index dcf5e52b7..ca84c5796 100644
--- a/pkg/logservice/commands_test.go
+++ b/pkg/logservice/commands_test.go
@@ -38,7 +38,7 @@ func TestHandleStartReplica(t *testing.T) {
 		s.handleCommands([]pb.ScheduleCommand{cmd})
 		mustHaveReplica(t, s.store, 1, 1)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestHandleStopReplica(t *testing.T) {
@@ -67,7 +67,7 @@ func TestHandleStopReplica(t *testing.T) {
 		s.handleCommands([]pb.ScheduleCommand{cmd})
 		assert.False(t, hasReplica(s.store, 1, 1))
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestHandleAddReplica(t *testing.T) {
diff --git a/pkg/logservice/service_test.go b/pkg/logservice/service_test.go
index af2017a5b..91bc9ae07 100644
--- a/pkg/logservice/service_test.go
+++ b/pkg/logservice/service_test.go
@@ -15,6 +15,7 @@
 package logservice
 
 import (
+	"context"
 	"testing"
 	"time"
 
@@ -42,7 +43,7 @@ func getServiceTestConfig() Config {
 	}
 }
 
-func runServiceTest(t *testing.T, fn func(*testing.T, *Service)) {
+func runServiceTest(t *testing.T, hakeeper bool, fn func(*testing.T, *Service)) {
 	defer leaktest.AfterTest(t)()
 	cfg := getServiceTestConfig()
 	defer vfs.ReportLeakedFD(cfg.FS, t)
@@ -50,7 +51,11 @@ func runServiceTest(t *testing.T, fn func(*testing.T, *Service)) {
 	require.NoError(t, err)
 	peers := make(map[uint64]dragonboat.Target)
 	peers[1] = service.ID()
-	require.NoError(t, service.store.StartReplica(1, 1, peers, false))
+	if hakeeper {
+		require.NoError(t, service.store.StartHAKeeperReplica(1, peers, false))
+	} else {
+		require.NoError(t, service.store.StartReplica(1, 1, peers, false))
+	}
 	defer func() {
 		assert.NoError(t, service.Close())
 	}()
@@ -80,7 +85,7 @@ func TestServiceConnect(t *testing.T) {
 		assert.Equal(t, pb.NoError, resp.ErrorCode)
 		assert.Equal(t, "", resp.ErrorMessage)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestServiceConnectTimeout(t *testing.T) {
@@ -97,7 +102,7 @@ func TestServiceConnectTimeout(t *testing.T) {
 		assert.Equal(t, pb.Timeout, resp.ErrorCode)
 		assert.Equal(t, "", resp.ErrorMessage)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestServiceConnectRO(t *testing.T) {
@@ -114,7 +119,7 @@ func TestServiceConnectRO(t *testing.T) {
 		assert.Equal(t, pb.NoError, resp.ErrorCode)
 		assert.Equal(t, "", resp.ErrorMessage)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func getTestAppendCmd(id uint64, data []byte) []byte {
@@ -125,6 +130,92 @@ func getTestAppendCmd(id uint64, data []byte) []byte {
 	return cmd
 }
 
+func TestServiceHandleLogHeartbeat(t *testing.T) {
+	fn := func(t *testing.T, s *Service) {
+		req := pb.Request{
+			Method:  pb.LOG_HEARTBEAT,
+			Timeout: int64(time.Second),
+			LogHeartbeat: pb.LogStoreHeartbeat{
+				UUID: "uuid1",
+			},
+		}
+		sc1 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 1,
+				},
+			},
+		}
+		sc2 := pb.ScheduleCommand{
+			UUID: "uuid2",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 2,
+				},
+			},
+		}
+		sc3 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 3,
+				},
+			},
+		}
+		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+		defer cancel()
+		require.NoError(t,
+			s.store.addScheduleCommands(ctx, 1, []pb.ScheduleCommand{sc1, sc2, sc3}))
+		resp := s.handleLogHeartbeat(req)
+		require.Equal(t, []pb.ScheduleCommand{sc1, sc3}, resp.CommandBatch.Commands)
+	}
+	runServiceTest(t, true, fn)
+}
+
+func TestServiceHandleDNHeartbeat(t *testing.T) {
+	fn := func(t *testing.T, s *Service) {
+		req := pb.Request{
+			Method:  pb.DN_HEARTBEAT,
+			Timeout: int64(time.Second),
+			DNHeartbeat: pb.DNStoreHeartbeat{
+				UUID: "uuid1",
+			},
+		}
+		sc1 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 1,
+				},
+			},
+		}
+		sc2 := pb.ScheduleCommand{
+			UUID: "uuid2",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 2,
+				},
+			},
+		}
+		sc3 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 3,
+				},
+			},
+		}
+		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+		defer cancel()
+		require.NoError(t,
+			s.store.addScheduleCommands(ctx, 1, []pb.ScheduleCommand{sc1, sc2, sc3}))
+		resp := s.handleDNHeartbeat(req)
+		require.Equal(t, []pb.ScheduleCommand{sc1, sc3}, resp.CommandBatch.Commands)
+	}
+	runServiceTest(t, true, fn)
+}
+
 func TestServiceHandleAppend(t *testing.T) {
 	fn := func(t *testing.T, s *Service) {
 		req := pb.Request{
@@ -153,7 +244,7 @@ func TestServiceHandleAppend(t *testing.T) {
 		assert.Equal(t, "", resp.ErrorMessage)
 		assert.Equal(t, uint64(4), resp.LogResponse.Index)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestServiceHandleAppendWhenNotBeingTheLeaseHolder(t *testing.T) {
@@ -184,7 +275,7 @@ func TestServiceHandleAppendWhenNotBeingTheLeaseHolder(t *testing.T) {
 		assert.Equal(t, "", resp.ErrorMessage)
 		assert.Equal(t, uint64(0), resp.LogResponse.Index)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestServiceHandleRead(t *testing.T) {
@@ -235,7 +326,7 @@ func TestServiceHandleRead(t *testing.T) {
 		assert.Equal(t, pb.UserRecord, records.Records[3].Type)
 		assert.Equal(t, cmd, records.Records[3].Data)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestServiceTruncate(t *testing.T) {
@@ -303,7 +394,7 @@ func TestServiceTruncate(t *testing.T) {
 		assert.Equal(t, pb.IndexAlreadyTruncated, resp.ErrorCode)
 		assert.Equal(t, "", resp.ErrorMessage)
 	}
-	runServiceTest(t, fn)
+	runServiceTest(t, false, fn)
 }
 
 func TestShardInfoCanBeQueried(t *testing.T) {
diff --git a/pkg/logservice/store_test.go b/pkg/logservice/store_test.go
index fed6e57f8..0f98faadf 100644
--- a/pkg/logservice/store_test.go
+++ b/pkg/logservice/store_test.go
@@ -271,6 +271,49 @@ func TestHAKeeperTick(t *testing.T) {
 	runStoreTest(t, fn)
 }
 
+func TestAddScheduleCommands(t *testing.T) {
+	fn := func(t *testing.T, store *store) {
+		peers := make(map[uint64]dragonboat.Target)
+		peers[1] = store.ID()
+		assert.NoError(t, store.StartHAKeeperReplica(1, peers, false))
+		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+		defer cancel()
+		sc1 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 1,
+				},
+			},
+		}
+		sc2 := pb.ScheduleCommand{
+			UUID: "uuid2",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 2,
+				},
+			},
+		}
+		sc3 := pb.ScheduleCommand{
+			UUID: "uuid1",
+			ConfigChange: &pb.ConfigChange{
+				Replica: pb.Replica{
+					ShardID: 3,
+				},
+			},
+		}
+		require.NoError(t,
+			store.addScheduleCommands(ctx, 1, []pb.ScheduleCommand{sc1, sc2, sc3}))
+		cb, err := store.GetCommandBatch(ctx, "uuid1")
+		require.NoError(t, err)
+		assert.Equal(t, []pb.ScheduleCommand{sc1, sc3}, cb.Commands)
+		cb, err = store.GetCommandBatch(ctx, "uuid2")
+		require.NoError(t, err)
+		assert.Equal(t, []pb.ScheduleCommand{sc2}, cb.Commands)
+	}
+	runStoreTest(t, fn)
+}
+
 func TestGetHeartbeatMessage(t *testing.T) {
 	fn := func(t *testing.T, store *store) {
 		peers := make(map[uint64]dragonboat.Target)