mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
fix: [2.4] Set corresponding DataScope for loadStreamDelete
(#35313)
Cherry-pick from master pr: #35312 Related to #35311 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
d0ce3f602e
commit
e64d27aa51
@ -644,6 +644,16 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
|
||||
position = deltaPositions[0]
|
||||
}
|
||||
|
||||
// after L0 segment feature
|
||||
// growing segemnts should have load stream delete as well
|
||||
deleteScope := querypb.DataScope_All
|
||||
switch candidate.Type() {
|
||||
case commonpb.SegmentState_Sealed:
|
||||
deleteScope = querypb.DataScope_Historical
|
||||
case commonpb.SegmentState_Growing:
|
||||
deleteScope = querypb.DataScope_Streaming
|
||||
}
|
||||
|
||||
deletedPks, deletedTss := sd.GetLevel0Deletions(candidate.Partition(), candidate)
|
||||
deleteData := &storage.DeleteData{}
|
||||
deleteData.AppendBatch(deletedPks, deletedTss)
|
||||
@ -658,7 +668,7 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
|
||||
SegmentId: info.GetSegmentID(),
|
||||
PrimaryKeys: storage.ParsePrimaryKeys2IDs(deleteData.Pks),
|
||||
Timestamps: deleteData.Tss,
|
||||
Scope: querypb.DataScope_Historical, // only sealed segment need to loadStreamDelete
|
||||
Scope: deleteScope,
|
||||
})
|
||||
if err != nil {
|
||||
log.Warn("failed to apply delete when LoadSegment", zap.Error(err))
|
||||
@ -716,6 +726,7 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
|
||||
SegmentId: info.GetSegmentID(),
|
||||
PrimaryKeys: storage.ParsePrimaryKeys2IDs(deleteData.Pks),
|
||||
Timestamps: deleteData.Tss,
|
||||
Scope: deleteScope,
|
||||
})
|
||||
if err != nil {
|
||||
log.Warn("failed to apply delete when LoadSegment", zap.Error(err))
|
||||
|
Loading…
Reference in New Issue
Block a user