Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions internal/core/src/pb/common.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/core/src/pb/common.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion internal/datacoord/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ func TestGetSegmentStates(t *testing.T) {
assert.EqualValues(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode)
assert.EqualValues(t, 1, len(resp.States))
if test.expected {
assert.EqualValues(t, commonpb.ErrorCode_Success, resp.States[0].Status.ErrorCode)
assert.EqualValues(t, test.expectedState, resp.States[0].State)
}
})
Expand Down
5 changes: 1 addition & 4 deletions internal/datacoord/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,12 @@ func (s *Server) GetSegmentStates(ctx context.Context, req *datapb.GetSegmentSta

for _, segmentID := range req.SegmentIDs {
state := &datapb.SegmentStateInfo{
Status: &commonpb.Status{},
SegmentID: segmentID,
}
segmentInfo := s.meta.GetSegment(segmentID)
if segmentInfo == nil {
state.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
state.Status.Reason = fmt.Sprintf("failed to get segment %d", segmentID)
state.State = commonpb.SegmentState_NotExist
} else {
state.Status.ErrorCode = commonpb.ErrorCode_Success
state.State = segmentInfo.GetState()
state.StartPosition = segmentInfo.GetStartPosition()
}
Expand Down
1 change: 1 addition & 0 deletions internal/proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ enum MsgType {
SegmentInfo = 600;
SystemInfo = 601;
GetRecoveryInfo = 602;
GetSegmentState = 603;

/* SYSTEM CONTROL */
TimeTick = 1200;
Expand Down
Loading