Remove lock for compaction sync segments (#25711)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/25880/head
cai.zhang 2023-07-24 17:25:00 +08:00 committed by GitHub
parent 76e03fe6d3
commit 779d677eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 11 deletions

View File

@ -358,8 +358,6 @@ func (node *DataNode) SyncSegments(ctx context.Context, req *datapb.SyncSegments
oneSegment int64
channel Channel
err error
ds *dataSyncService
ok bool
)
for _, fromSegment := range req.GetCompactedFrom() {
@ -368,11 +366,6 @@ func (node *DataNode) SyncSegments(ctx context.Context, req *datapb.SyncSegments
log.Ctx(ctx).Warn("fail to get the channel", zap.Int64("segment", fromSegment), zap.Error(err))
continue
}
ds, ok = node.flowgraphManager.getFlowgraphService(channel.getChannelName(fromSegment))
if !ok {
log.Ctx(ctx).Warn("fail to find flow graph service", zap.Int64("segment", fromSegment))
continue
}
oneSegment = fromSegment
break
}
@ -396,11 +389,7 @@ func (node *DataNode) SyncSegments(ctx context.Context, req *datapb.SyncSegments
return merr.Status(err), nil
}
// block all flow graph so it's safe to remove segment
ds.fg.Blockall()
defer ds.fg.Unblock()
if err := channel.mergeFlushedSegments(ctx, targetSeg, req.GetPlanID(), req.GetCompactedFrom()); err != nil {
node.compactionExecutor.injectDone(req.GetPlanID(), false)
return merr.Status(err), nil
}
node.compactionExecutor.injectDone(req.GetPlanID(), true)