Change master meta prefix

Signed-off-by: neza2017 <yefu.chen@zilliz.com>
This commit is contained in:
neza2017 2021-02-09 10:36:31 +08:00 committed by yefu.chen
parent 7901d98d5e
commit c2956dbe92
2 changed files with 16 additions and 12 deletions

View File

@ -17,12 +17,13 @@ import (
)
const (
TenantMetaPrefix = "tenant"
ProxyMetaPrefix = "proxy"
CollectionMetaPrefix = "collection"
PartitionMetaPrefix = "partition"
SegmentIndexMetaPrefix = "segment-index"
IndexMetaPrefix = "index"
ComponentPrefix = "master-service"
TenantMetaPrefix = ComponentPrefix + "/tenant"
ProxyMetaPrefix = ComponentPrefix + "/proxy"
CollectionMetaPrefix = ComponentPrefix + "/collection"
PartitionMetaPrefix = ComponentPrefix + "/partition"
SegmentIndexMetaPrefix = ComponentPrefix + "/segment-index"
IndexMetaPrefix = ComponentPrefix + "/index"
)
type metaTable struct {

View File

@ -449,19 +449,22 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest)
segmentIDs := make([]UniqueID, 0)
fmt.Println("start release partitions start, partitionIDs = ", partitionIDs)
for _, partitionID := range partitionIDs {
segments, err := qs.replica.getSegments(dbID, collectionID, partitionID)
showSegmentRequest := &milvuspb.ShowSegmentRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_kShowSegment,
},
CollectionID: collectionID,
PartitionID: partitionID,
}
showSegmentResponse, err := qs.masterServiceClient.ShowSegments(showSegmentRequest)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
Reason: err.Error(),
}, err
}
res := make([]UniqueID, 0)
for _, segment := range segments {
res = append(res, segment.id)
}
segmentIDs = append(segmentIDs, res...)
segmentIDs = append(segmentIDs, showSegmentResponse.SegmentIDs...)
err = qs.replica.releasePartition(dbID, collectionID, partitionID)
if err != nil {
return &commonpb.Status{