mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
DataCoord GetSegmentInfo should return binlog info with logpath instead logid when segment merge child segment's binlog. relate: https://github.com/milvus-io/milvus/issues/30366 https://github.com/milvus-io/milvus/issues/30165 https://github.com/milvus-io/milvus/issues/30550 Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
parent
6f184d354f
commit
2180e2cfae
@ -418,6 +418,8 @@ func (s *Server) GetSegmentInfo(ctx context.Context, req *datapb.GetSegmentInfoR
|
||||
child := s.meta.GetCompactionTo(id)
|
||||
clonedInfo := info.Clone()
|
||||
if child != nil {
|
||||
// child segment should decompress binlog path
|
||||
binlog.DecompressBinLog(storage.DeleteBinlog, child.GetCollectionID(), child.GetPartitionID(), child.GetID(), child.GetDeltalogs())
|
||||
clonedInfo.Deltalogs = append(clonedInfo.Deltalogs, child.GetDeltalogs()...)
|
||||
clonedInfo.DmlPosition = child.GetDmlPosition()
|
||||
}
|
||||
|
||||
@ -603,6 +603,32 @@ func (s *ServerSuite) TestGetSegmentInfoChannel() {
|
||||
s.EqualValues(Params.CommonCfg.DataCoordSegmentInfo.GetValue(), resp.Value)
|
||||
}
|
||||
|
||||
func (s *ServerSuite) TestGetSegmentInfo() {
|
||||
testSegmentID := int64(1)
|
||||
s.testServer.meta.AddSegment(context.TODO(), &SegmentInfo{
|
||||
SegmentInfo: &datapb.SegmentInfo{
|
||||
ID: 1,
|
||||
Deltalogs: []*datapb.FieldBinlog{{FieldID: 100, Binlogs: []*datapb.Binlog{{LogID: 100}}}},
|
||||
},
|
||||
})
|
||||
|
||||
s.testServer.meta.AddSegment(context.TODO(), &SegmentInfo{
|
||||
SegmentInfo: &datapb.SegmentInfo{
|
||||
ID: 2,
|
||||
Deltalogs: []*datapb.FieldBinlog{{FieldID: 100, Binlogs: []*datapb.Binlog{{LogID: 101}}}},
|
||||
CompactionFrom: []int64{1},
|
||||
},
|
||||
})
|
||||
|
||||
resp, err := s.testServer.GetSegmentInfo(context.TODO(), &datapb.GetSegmentInfoRequest{
|
||||
SegmentIDs: []int64{testSegmentID},
|
||||
IncludeUnHealthy: true,
|
||||
})
|
||||
s.NoError(err)
|
||||
log.Info("test--", zap.Any("resp", resp))
|
||||
s.EqualValues(2, len(resp.Infos[0].Deltalogs))
|
||||
}
|
||||
|
||||
func (s *ServerSuite) TestAssignSegmentID() {
|
||||
s.TearDownTest()
|
||||
const collID = 100
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user