未验证 提交 8f84208c 编写于 作者: B Bingyi Sun 提交者: GitHub

Move growing segments to leaderview in GetDataDistributionResponse (#19292)

Signed-off-by: Nsunby <bingyi.sun@zilliz.com>
Signed-off-by: Nsunby <bingyi.sun@zilliz.com>
Co-authored-by: Nsunby <bingyi.sun@zilliz.com>
上级 0306f71b
......@@ -414,16 +414,16 @@ message GetDataDistributionRequest {
message GetDataDistributionResponse {
common.Status status = 1;
int64 nodeID = 2;
repeated int64 growing_segmentIDs = 3;
repeated SegmentVersionInfo segments = 4;
repeated ChannelVersionInfo channels = 5;
repeated LeaderView leaderViews = 6;
repeated SegmentVersionInfo segments = 3;
repeated ChannelVersionInfo channels = 4;
repeated LeaderView leader_views = 5;
}
message LeaderView {
int64 collection = 1;
string channel = 2;
map<int64, int64> segmentNodePairs = 3;
map<int64, int64> segment_node_pairs = 3;
repeated int64 growing_segmentIDs = 4;
}
......
......@@ -163,7 +163,7 @@ func (dh *distHandler) updateLeaderView(resp *querypb.GetDataDistributionRespons
CollectionID: lview.GetCollection(),
Channel: lview.GetChannel(),
Segments: lview.GetSegmentNodePairs(),
GrowingSegments: typeutil.NewUniqueSet(resp.GetGrowingSegmentIDs()...),
GrowingSegments: typeutil.NewUniqueSet(lview.GetGrowingSegmentIDs()...),
}
updates = append(updates, view)
}
......
......@@ -1167,9 +1167,9 @@ func (node *QueryNode) GetDataDistribution(ctx context.Context, req *querypb.Get
sealedSegments := node.metaReplica.getSealedSegments()
shardClusters := node.ShardClusterService.GetShardClusters()
growinsgSegmentIDs := make([]int64, 0, len(growingSegments))
channelGrowingsMap := make(map[string][]int64)
for _, s := range growingSegments {
growinsgSegmentIDs = append(growinsgSegmentIDs, s.ID())
channelGrowingsMap[s.vChannelID] = append(channelGrowingsMap[s.vChannelID], s.ID())
}
segmentVersionInfos := make([]*querypb.SegmentVersionInfo, 0, len(sealedSegments))
......@@ -1196,9 +1196,10 @@ func (node *QueryNode) GetDataDistribution(ctx context.Context, req *querypb.Get
mapping[info.segmentID] = info.nodeID
}
view := &querypb.LeaderView{
Collection: sc.collectionID,
Channel: sc.vchannelName,
SegmentNodePairs: mapping,
Collection: sc.collectionID,
Channel: sc.vchannelName,
SegmentNodePairs: mapping,
GrowingSegmentIDs: channelGrowingsMap[sc.vchannelName],
}
leaderViews = append(leaderViews, view)
......@@ -1211,12 +1212,11 @@ func (node *QueryNode) GetDataDistribution(ctx context.Context, req *querypb.Get
}
return &querypb.GetDataDistributionResponse{
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
NodeID: node.session.ServerID,
GrowingSegmentIDs: growinsgSegmentIDs,
Segments: segmentVersionInfos,
Channels: channelVersionInfos,
LeaderViews: leaderViews,
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
NodeID: node.session.ServerID,
Segments: segmentVersionInfos,
Channels: channelVersionInfos,
LeaderViews: leaderViews,
}, nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册