mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 19:08:30 +08:00
Maintain compatibility of GetFlushState with old client (#27077)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
6f2c1214ed
commit
fe5781e2b8
@ -3607,7 +3607,7 @@ func TestGetFlushState(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, &milvuspb.GetFlushStateResponse{
|
||||
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
|
||||
Flushed: false,
|
||||
Flushed: true,
|
||||
}, resp)
|
||||
})
|
||||
}
|
||||
|
@ -1309,10 +1309,10 @@ func (s *Server) GetFlushState(ctx context.Context, req *datapb.GetFlushStateReq
|
||||
channels = append(channels, channelNames...)
|
||||
}
|
||||
|
||||
if len(channels) == 0 {
|
||||
resp.Flushed = false
|
||||
if len(channels) == 0 { // For compatibility with old client
|
||||
resp.Flushed = true
|
||||
resp.Status.ErrorCode = commonpb.ErrorCode_Success
|
||||
log.Warn("GetFlushState failed, no channels found")
|
||||
log.Info("GetFlushState all flushed without checking flush ts")
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
|
@ -3617,21 +3617,23 @@ func (node *Proxy) GetFlushState(ctx context.Context, req *milvuspb.GetFlushStat
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
if err = validateCollectionName(req.GetCollectionName()); err != nil {
|
||||
resp.Status = merr.Status(err)
|
||||
return resp, nil
|
||||
}
|
||||
collectionID, err := globalMetaCache.GetCollectionID(ctx, req.GetDbName(), req.GetCollectionName())
|
||||
if err != nil {
|
||||
resp.Status = merr.Status(err)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
stateReq := &datapb.GetFlushStateRequest{
|
||||
SegmentIDs: req.GetSegmentIDs(),
|
||||
FlushTs: req.GetFlushTs(),
|
||||
}
|
||||
stateReq.CollectionID = collectionID
|
||||
|
||||
if len(req.GetCollectionName()) > 0 { // For compatibility with old client
|
||||
if err = validateCollectionName(req.GetCollectionName()); err != nil {
|
||||
resp.Status = merr.Status(err)
|
||||
return resp, nil
|
||||
}
|
||||
collectionID, err := globalMetaCache.GetCollectionID(ctx, req.GetDbName(), req.GetCollectionName())
|
||||
if err != nil {
|
||||
resp.Status = merr.Status(err)
|
||||
return resp, nil
|
||||
}
|
||||
stateReq.CollectionID = collectionID
|
||||
}
|
||||
|
||||
resp, err = node.dataCoord.GetFlushState(ctx, stateReq)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user