Change SegmentInfo

Signed-off-by: sunby <bingyi.sun@zilliz.com>
pull/4973/head^2
sunby 2021-02-02 18:53:10 +08:00 committed by yefu.chen
parent 5e781b9370
commit f3aad3a71c
26 changed files with 315 additions and 313 deletions

View File

@ -16,6 +16,7 @@
#include "knowhere/index/vector_index/VecIndex.h"
struct LoadIndexInfo {
std::string field_name;
int64_t field_id;
std::map<std::string, std::string> index_params;
milvus::knowhere::VecIndexPtr index;

View File

@ -59,9 +59,11 @@ AppendIndexParam(CLoadIndexInfo c_load_index_info, const char* c_index_key, cons
}
CStatus
AppendFieldInfo(CLoadIndexInfo c_load_index_info, int64_t field_id) {
AppendFieldInfo(CLoadIndexInfo c_load_index_info, const char* c_field_name, int64_t field_id) {
try {
auto load_index_info = (LoadIndexInfo*)c_load_index_info;
std::string field_name(c_field_name);
load_index_info->field_name = field_name;
load_index_info->field_id = field_id;
auto status = CStatus();
@ -95,6 +97,7 @@ AppendIndex(CLoadIndexInfo c_load_index_info, CBinarySet c_binary_set) {
load_index_info->index =
milvus::knowhere::VecIndexFactory::GetInstance().CreateVecIndex(index_params["index_type"], mode);
load_index_info->index->Load(*binary_set);
auto status = CStatus();
status.error_code = Success;
status.error_msg = "";

View File

@ -33,7 +33,7 @@ CStatus
AppendIndexParam(CLoadIndexInfo c_load_index_info, const char* index_key, const char* index_value);
CStatus
AppendFieldInfo(CLoadIndexInfo c_load_index_info, int64_t field_id);
AppendFieldInfo(CLoadIndexInfo c_load_index_info, const char* field_name, int64_t field_id);
CStatus
AppendIndex(CLoadIndexInfo c_load_index_info, CBinarySet c_binary_set);

View File

@ -781,7 +781,7 @@ TEST(CApiTest, LoadIndexInfo) {
status = AppendIndexParam(c_load_index_info, index_param_key2.data(), index_param_value2.data());
assert(status.error_code == Success);
std::string field_name = "field0";
status = AppendFieldInfo(c_load_index_info, 0);
status = AppendFieldInfo(c_load_index_info, field_name.data(), 0);
assert(status.error_code == Success);
status = AppendIndex(c_load_index_info, c_binary_set);
assert(status.error_code == Success);
@ -937,7 +937,7 @@ TEST(CApiTest, UpdateSegmentIndex_Without_Predicate) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
status = UpdateSegmentIndex(segment, c_load_index_info);
@ -1074,7 +1074,7 @@ TEST(CApiTest, UpdateSegmentIndex_With_float_Predicate_Range) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
status = UpdateSegmentIndex(segment, c_load_index_info);
@ -1211,7 +1211,7 @@ TEST(CApiTest, UpdateSegmentIndex_With_float_Predicate_Term) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
status = UpdateSegmentIndex(segment, c_load_index_info);
@ -1350,7 +1350,7 @@ TEST(CApiTest, UpdateSegmentIndex_With_binary_Predicate_Range) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
status = UpdateSegmentIndex(segment, c_load_index_info);
@ -1488,7 +1488,7 @@ TEST(CApiTest, UpdateSegmentIndex_With_binary_Predicate_Term) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
status = UpdateSegmentIndex(segment, c_load_index_info);
@ -1665,7 +1665,7 @@ TEST(CApiTest, SealedSegment_search_float_Predicate_Range) {
AppendIndexParam(c_load_index_info, index_type_key.c_str(), index_type_value.c_str());
AppendIndexParam(c_load_index_info, index_mode_key.c_str(), index_mode_value.c_str());
AppendIndexParam(c_load_index_info, metric_type_key.c_str(), metric_type_value.c_str());
AppendFieldInfo(c_load_index_info, 100);
AppendFieldInfo(c_load_index_info, "fakevec", 100);
AppendIndex(c_load_index_info, (CBinarySet)&binary_set);
auto load_index_info = (LoadIndexInfo*)c_load_index_info;

View File

@ -105,6 +105,7 @@ TEST(Sealed, without_predicate) {
auto ref_result = QueryResultToJson(qr);
LoadIndexInfo load_info;
load_info.field_name = "fakevec";
load_info.field_id = fake_id.get();
load_info.index = indexing;
load_info.index_params["metric_type"] = "L2";
@ -197,6 +198,7 @@ TEST(Sealed, with_predicate) {
auto result = indexing->Query(query_dataset, conf, nullptr);
LoadIndexInfo load_info;
load_info.field_name = "fakevec";
load_info.field_id = fake_id.get();
load_info.index = indexing;
load_info.index_params["metric_type"] = "L2";
@ -310,6 +312,7 @@ TEST(Sealed, LoadFieldData) {
LoadIndexInfo vec_info;
vec_info.field_id = fakevec_id.get();
vec_info.field_name = "fakevec";
vec_info.index = indexing;
vec_info.index_params["metric_type"] = milvus::knowhere::Metric::L2;
segment->LoadIndex(vec_info);

View File

@ -1,76 +1,38 @@
package dataservice
import (
"fmt"
"strconv"
"sync"
)
type (
channelGroup []string
insertChannelManager struct {
mu sync.RWMutex
count int
channelGroups map[UniqueID][]channelGroup // collection id to channel ranges
channelGroups map[UniqueID][]string // collection id to channel ranges
}
)
func (cr channelGroup) Contains(channelName string) bool {
for _, name := range cr {
if name == channelName {
return true
}
}
return false
}
func newInsertChannelManager() *insertChannelManager {
return &insertChannelManager{
count: 0,
channelGroups: make(map[UniqueID][]channelGroup),
channelGroups: make(map[UniqueID][]string),
}
}
func (cm *insertChannelManager) GetChannels(collectionID UniqueID, groupNum int) ([]channelGroup, error) {
func (cm *insertChannelManager) GetChannels(collectionID UniqueID) ([]string, error) {
cm.mu.Lock()
defer cm.mu.Unlock()
if _, ok := cm.channelGroups[collectionID]; ok {
return cm.channelGroups[collectionID], nil
}
channels := Params.InsertChannelNumPerCollection
m, n := channels/int64(groupNum), channels%int64(groupNum)
cg := make([]channelGroup, 0)
var i, j int64 = 0, 0
for i < channels {
var group []string
if j < n {
group = make([]string, m+1)
} else {
group = make([]string, m)
}
for k := 0; k < len(group); k++ {
group[k] = Params.InsertChannelPrefixName + strconv.Itoa(cm.count)
cm.count++
}
i += int64(len(group))
j++
cg = append(cg, group)
cg := make([]string, channels)
var i int64 = 0
for ; i < channels; i++ {
cg[i] = Params.InsertChannelPrefixName + strconv.Itoa(cm.count)
cm.count++
}
cm.channelGroups[collectionID] = cg
return cg, nil
}
func (cm *insertChannelManager) GetChannelGroup(collectionID UniqueID, channelName string) (channelGroup, error) {
cm.mu.RLock()
defer cm.mu.RUnlock()
_, ok := cm.channelGroups[collectionID]
if !ok {
return nil, fmt.Errorf("can not find collection %d", collectionID)
}
for _, cr := range cm.channelGroups[collectionID] {
if cr.Contains(channelName) {
return cr, nil
}
}
return nil, fmt.Errorf("channel name %s not found", channelName)
}

View File

@ -1,33 +1,21 @@
package dataservice
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
)
func TestChannelAllocation(t *testing.T) {
func TestGetChannel(t *testing.T) {
Params.Init()
Params.InsertChannelNumPerCollection = 4
Params.InsertChannelPrefixName = "channel"
manager := newInsertChannelManager()
cases := []struct {
collectionID UniqueID
groupNum int
expectGroupNum int
}{
{1, 4, 4},
{1, 4, 4},
{2, 1, 1},
{3, 5, 4},
}
for _, c := range cases {
channels, err := manager.GetChannels(c.collectionID, c.expectGroupNum)
assert.Nil(t, err)
assert.EqualValues(t, c.expectGroupNum, len(channels))
total := 0
for _, channel := range channels {
total += len(channel)
}
assert.EqualValues(t, Params.InsertChannelNumPerCollection, total)
channels, err := manager.GetChannels(1)
assert.Nil(t, err)
assert.EqualValues(t, Params.InsertChannelNumPerCollection, len(channels))
for i := 0; i < len(channels); i++ {
assert.EqualValues(t, Params.InsertChannelPrefixName+strconv.Itoa(i), channels[i])
}
}

View File

@ -23,16 +23,18 @@ type (
channelNum int
}
dataNodeCluster struct {
mu sync.RWMutex
finishCh chan struct{}
nodes []*dataNode
mu sync.RWMutex
finishCh chan struct{}
nodes []*dataNode
watchedCollection map[UniqueID]bool
}
)
func newDataNodeCluster(finishCh chan struct{}) *dataNodeCluster {
return &dataNodeCluster{
finishCh: finishCh,
nodes: make([]*dataNode, 0),
finishCh: finishCh,
nodes: make([]*dataNode, 0),
watchedCollection: make(map[UniqueID]bool),
}
}
@ -49,7 +51,7 @@ func (c *dataNodeCluster) Register(dataNode *dataNode) {
func (c *dataNodeCluster) checkDataNodeNotExist(ip string, port int64) bool {
for _, node := range c.nodes {
if node.address.ip == ip || node.address.port == port {
if node.address.ip == ip && node.address.port == port {
return false
}
}
@ -70,12 +72,25 @@ func (c *dataNodeCluster) GetNodeIDs() []int64 {
return ret
}
func (c *dataNodeCluster) WatchInsertChannels(groups []channelGroup) {
func (c *dataNodeCluster) WatchInsertChannels(collectionID UniqueID, channels []string) {
c.mu.Lock()
defer c.mu.Unlock()
if c.watchedCollection[collectionID] {
return
}
sort.Slice(c.nodes, func(i, j int) bool { return c.nodes[i].channelNum < c.nodes[j].channelNum })
var groups [][]string
if len(channels) < len(c.nodes) {
groups = make([][]string, len(channels))
} else {
groups = make([][]string, len(c.nodes))
}
length := len(groups)
for i, channel := range channels {
groups[i%length] = append(groups[i%length], channel)
}
for i, group := range groups {
_, err := c.nodes[i%len(c.nodes)].client.WatchDmChannels(&datapb.WatchDmChannelRequest{
resp, err := c.nodes[i].client.WatchDmChannels(&datapb.WatchDmChannelRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_kDescribeCollection,
MsgID: -1, // todo
@ -88,7 +103,13 @@ func (c *dataNodeCluster) WatchInsertChannels(groups []channelGroup) {
log.Println(err.Error())
continue
}
if resp.ErrorCode != commonpb.ErrorCode_SUCCESS {
log.Println(resp.Reason)
continue
}
c.nodes[i].channelNum += len(group)
}
c.watchedCollection[collectionID] = true
}
func (c *dataNodeCluster) GetDataNodeStates() ([]*internalpb2.ComponentInfo, error) {
@ -125,3 +146,12 @@ func (c *dataNodeCluster) ShutDownClients() {
}
}
}
// Clear only for test
func (c *dataNodeCluster) Clear() {
c.mu.Lock()
defer c.mu.Unlock()
c.finishCh = make(chan struct{})
c.nodes = make([]*dataNode, 0)
c.watchedCollection = make(map[UniqueID]bool)
}

View File

@ -0,0 +1,42 @@
package dataservice
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestWatchChannels(t *testing.T) {
Params.Init()
Params.DataNodeNum = 3
cases := []struct {
collectionID UniqueID
channels []string
channelNums []int
}{
{1, []string{"c1"}, []int{1, 0, 0}},
{1, []string{"c1", "c2", "c3"}, []int{1, 1, 1}},
{1, []string{"c1", "c2", "c3", "c4"}, []int{2, 1, 1}},
{1, []string{"c1", "c2", "c3", "c4", "c5", "c6", "c7"}, []int{3, 2, 2}},
}
cluster := newDataNodeCluster(make(chan struct{}))
for _, c := range cases {
for i := 0; i < Params.DataNodeNum; i++ {
cluster.Register(&dataNode{
id: int64(i),
address: struct {
ip string
port int64
}{"localhost", int64(9999 + i)},
client: newMockDataNodeClient(),
channelNum: 0,
})
}
cluster.WatchInsertChannels(c.collectionID, c.channels)
for i := 0; i < len(cluster.nodes); i++ {
assert.EqualValues(t, c.channelNums[i], cluster.nodes[i].channelNum)
}
cluster.Clear()
}
}

View File

@ -386,16 +386,16 @@ func (meta *meta) removeSegments(segIDs []UniqueID) error {
return meta.client.MultiRemove(segmentPaths)
}
func BuildSegment(collectionID UniqueID, partitionID UniqueID, segmentID UniqueID, channelRange []string) (*datapb.SegmentInfo, error) {
func BuildSegment(collectionID UniqueID, partitionID UniqueID, segmentID UniqueID, channelName string) (*datapb.SegmentInfo, error) {
return &datapb.SegmentInfo{
SegmentID: segmentID,
CollectionID: collectionID,
PartitionID: partitionID,
InsertChannels: channelRange,
OpenTime: 0,
SealedTime: 0,
NumRows: 0,
MemSize: 0,
State: datapb.SegmentState_SegmentGrowing,
SegmentID: segmentID,
CollectionID: collectionID,
PartitionID: partitionID,
InsertChannel: channelName,
OpenTime: 0,
SealedTime: 0,
NumRows: 0,
MemSize: 0,
State: datapb.SegmentState_SegmentGrowing,
}, nil
}

View File

@ -48,7 +48,7 @@ func TestSegment(t *testing.T) {
assert.Nil(t, err)
segID, err := mockAllocator.allocID()
assert.Nil(t, err)
segmentInfo, err := BuildSegment(id, 100, segID, []string{"c1", "c2"})
segmentInfo, err := BuildSegment(id, 100, segID, "c1")
assert.Nil(t, err)
err = meta.AddSegment(segmentInfo)
assert.Nil(t, err)
@ -114,14 +114,14 @@ func TestGetCount(t *testing.T) {
nums, err := meta.GetNumRowsOfCollection(id)
assert.Nil(t, err)
assert.EqualValues(t, 0, nums)
segment, err := BuildSegment(id, 100, segID, []string{"c1"})
segment, err := BuildSegment(id, 100, segID, "c1")
assert.Nil(t, err)
segment.NumRows = 100
err = meta.AddSegment(segment)
assert.Nil(t, err)
segID, err = mockAllocator.allocID()
assert.Nil(t, err)
segment, err = BuildSegment(id, 100, segID, []string{"c1"})
segment, err = BuildSegment(id, 100, segID, "c1")
assert.Nil(t, err)
segment.NumRows = 300
err = meta.AddSegment(segment)

View File

@ -4,6 +4,10 @@ import (
"sync/atomic"
"time"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
"github.com/zilliztech/milvus-distributed/internal/proto/datapb"
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
memkv "github.com/zilliztech/milvus-distributed/internal/kv/mem"
@ -46,3 +50,27 @@ func newTestSchema() *schemapb.CollectionSchema {
},
}
}
type mockDataNodeClient struct {
}
func newMockDataNodeClient() *mockDataNodeClient {
return &mockDataNodeClient{}
}
func (c *mockDataNodeClient) WatchDmChannels(in *datapb.WatchDmChannelRequest) (*commonpb.Status, error) {
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, nil
}
func (c *mockDataNodeClient) GetComponentStates(empty *commonpb.Empty) (*internalpb2.ComponentStates, error) {
// todo
return nil, nil
}
func (c *mockDataNodeClient) FlushSegments(in *datapb.FlushSegRequest) (*commonpb.Status, error) {
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, nil
}
func (c *mockDataNodeClient) Stop() error {
return nil
}

View File

@ -54,7 +54,7 @@ type (
sealed bool
lastExpireTime Timestamp
allocations []*allocation
channelGroup channelGroup
insertChannel string
}
allocation struct {
rowNums int
@ -100,7 +100,7 @@ func (allocator *segmentAllocatorImpl) OpenSegment(segmentInfo *datapb.SegmentIn
total: totalRows,
sealed: false,
lastExpireTime: 0,
channelGroup: segmentInfo.InsertChannels,
insertChannel: segmentInfo.InsertChannel,
}
return nil
}
@ -112,7 +112,7 @@ func (allocator *segmentAllocatorImpl) AllocSegment(collectionID UniqueID,
for _, segStatus := range allocator.segments {
if segStatus.sealed || segStatus.collectionID != collectionID || segStatus.partitionID != partitionID ||
!segStatus.channelGroup.Contains(channelName) {
segStatus.insertChannel != channelName {
continue
}
var success bool

View File

@ -1,11 +1,14 @@
package dataservice
import (
"log"
"math"
"strconv"
"testing"
"time"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/stretchr/testify/assert"
)
@ -27,7 +30,7 @@ func TestAllocSegment(t *testing.T) {
assert.Nil(t, err)
id, err := mockAllocator.allocID()
assert.Nil(t, err)
segmentInfo, err := BuildSegment(collID, 100, id, []string{"c1", "c2"})
segmentInfo, err := BuildSegment(collID, 100, id, "c1")
assert.Nil(t, err)
err = meta.AddSegment(segmentInfo)
assert.Nil(t, err)
@ -80,7 +83,7 @@ func TestSealSegment(t *testing.T) {
for i := 0; i < 10; i++ {
id, err := mockAllocator.allocID()
assert.Nil(t, err)
segmentInfo, err := BuildSegment(collID, 100, id, []string{"c" + strconv.Itoa(i)})
segmentInfo, err := BuildSegment(collID, 100, id, "c"+strconv.Itoa(i))
assert.Nil(t, err)
err = meta.AddSegment(segmentInfo)
assert.Nil(t, err)
@ -115,21 +118,32 @@ func TestExpireSegment(t *testing.T) {
assert.Nil(t, err)
id, err := mockAllocator.allocID()
assert.Nil(t, err)
segmentInfo, err := BuildSegment(collID, 100, id, []string{"c1", "c2"})
segmentInfo, err := BuildSegment(collID, 100, id, "c1")
assert.Nil(t, err)
err = meta.AddSegment(segmentInfo)
assert.Nil(t, err)
err = segAllocator.OpenSegment(segmentInfo)
assert.Nil(t, err)
id1, _, _, err := segAllocator.AllocSegment(collID, 100, "c1", 10)
id1, _, et, err := segAllocator.AllocSegment(collID, 100, "c1", 10)
ts2, _ := tsoutil.ParseTS(et)
log.Printf("physical ts: %s", ts2.String())
assert.Nil(t, err)
time.Sleep(time.Duration(Params.SegIDAssignExpiration) * time.Millisecond)
ts, err := mockAllocator.allocTimestamp()
assert.Nil(t, err)
t1, _ := tsoutil.ParseTS(ts)
log.Printf("before ts: %s", t1.String())
time.Sleep(time.Duration(Params.SegIDAssignExpiration+1000) * time.Millisecond)
ts, err = mockAllocator.allocTimestamp()
assert.Nil(t, err)
err = segAllocator.ExpireAllocations(ts)
assert.Nil(t, err)
expired, err := segAllocator.IsAllocationsExpired(id1, ts)
if et > ts {
tsPhy, _ := tsoutil.ParseTS(ts)
log.Printf("ts %s", tsPhy.String())
}
assert.Nil(t, err)
assert.True(t, expired)
assert.EqualValues(t, 0, len(segAllocator.segments[id1].allocations))

View File

@ -555,16 +555,11 @@ func (s *Server) AssignSegmentID(req *datapb.AssignSegIDRequest) (*datapb.Assign
}
func (s *Server) openNewSegment(collectionID UniqueID, partitionID UniqueID, channelName string) error {
group, err := s.insertChannelMgr.GetChannelGroup(collectionID, channelName)
if err != nil {
return err
}
id, err := s.allocator.allocID()
if err != nil {
return err
}
segmentInfo, err := BuildSegment(collectionID, partitionID, id, group)
segmentInfo, err := BuildSegment(collectionID, partitionID, id, channelName)
if err != nil {
return err
}
@ -683,16 +678,12 @@ func (s *Server) GetInsertChannels(req *datapb.InsertChannelRequest) ([]string,
if !s.checkStateIsHealthy() {
return nil, errors.New("server is initializing")
}
channelGroups, err := s.insertChannelMgr.GetChannels(req.CollectionID, s.cluster.GetNumOfNodes())
channels, err := s.insertChannelMgr.GetChannels(req.CollectionID)
if err != nil {
return nil, err
}
channels := make([]string, 0)
for _, group := range channelGroups {
channels = append(channels, group...)
}
s.cluster.WatchInsertChannels(channelGroups)
s.cluster.WatchInsertChannels(req.CollectionID, channels)
return channels, nil
}

View File

@ -52,7 +52,7 @@ func TestDataNodeTTWatcher(t *testing.T) {
segID, err := allocator.allocID()
segmentIDs[i] = segID
assert.Nil(t, err)
segmentInfo, err := BuildSegment(id, 100, segID, []string{"channel" + strconv.Itoa(i)})
segmentInfo, err := BuildSegment(id, 100, segID, "channel"+strconv.Itoa(i))
assert.Nil(t, err)
err = meta.AddSegment(segmentInfo)
assert.Nil(t, err)
@ -64,7 +64,7 @@ func TestDataNodeTTWatcher(t *testing.T) {
}
}
time.Sleep(time.Duration(Params.SegIDAssignExpiration) * time.Millisecond)
time.Sleep(time.Duration(Params.SegIDAssignExpiration+1000) * time.Millisecond)
for i, c := range cases {
if c.allocation && !c.expired {
_, _, _, err := segAllocator.AllocSegment(id, 100, "channel"+strconv.Itoa(i), 100)

View File

@ -98,7 +98,7 @@ func TestGrpcService(t *testing.T) {
var binlogLock sync.Mutex
binlogPathArray := make([]string, 0, 16)
core.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error) {
core.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error) {
binlogLock.Lock()
defer binlogLock.Unlock()
binlogPathArray = append(binlogPathArray, binlog...)

View File

@ -152,7 +152,7 @@ type Core struct {
GetBinlogFilePathsFromDataServiceReq func(segID typeutil.UniqueID, fieldID typeutil.UniqueID) ([]string, error)
//TODO, call index builder's client to build index, return build id
BuildIndexReq func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error)
BuildIndexReq func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error)
//TODO, proxy service interface, notify proxy service to drop collection
InvalidateCollectionMetaCache func(ts typeutil.Timestamp, dbName string, collectionName string) error
@ -671,13 +671,11 @@ func (c *Core) SetDataService(s DataServiceInterface) error {
}
func (c *Core) SetIndexService(s IndexServiceInterface) error {
c.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair, indexID typeutil.UniqueID, indexName string) (typeutil.UniqueID, error) {
c.BuildIndexReq = func(binlog []string, typeParams []*commonpb.KeyValuePair, indexParams []*commonpb.KeyValuePair) (typeutil.UniqueID, error) {
rsp, err := s.BuildIndex(&indexpb.BuildIndexRequest{
DataPaths: binlog,
TypeParams: typeParams,
IndexParams: indexParams,
IndexID: indexID,
IndexName: indexName,
})
if err != nil {
return 0, err

View File

@ -628,7 +628,7 @@ func (t *CreateIndexTask) BuildIndex() error {
})
}
}
bldID, err = t.core.BuildIndexReq(binlogs, t.fieldSchema.TypeParams, t.indexParams, idxID, t.indexName)
bldID, err = t.core.BuildIndexReq(binlogs, t.fieldSchema.TypeParams, t.indexParams)
if err != nil {
return err
}

View File

@ -137,7 +137,7 @@ message SegmentInfo {
int64 segmentID = 1;
int64 collectionID = 2;
int64 partitionID = 3;
repeated string insert_channels = 4;
string insert_channel = 4;
uint64 open_time = 5;
uint64 sealed_time = 6;
uint64 flushed_time = 7;

View File

@ -1064,7 +1064,7 @@ type SegmentInfo struct {
SegmentID int64 `protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"`
CollectionID int64 `protobuf:"varint,2,opt,name=collectionID,proto3" json:"collectionID,omitempty"`
PartitionID int64 `protobuf:"varint,3,opt,name=partitionID,proto3" json:"partitionID,omitempty"`
InsertChannels []string `protobuf:"bytes,4,rep,name=insert_channels,json=insertChannels,proto3" json:"insert_channels,omitempty"`
InsertChannel string `protobuf:"bytes,4,opt,name=insert_channel,json=insertChannel,proto3" json:"insert_channel,omitempty"`
OpenTime uint64 `protobuf:"varint,5,opt,name=open_time,json=openTime,proto3" json:"open_time,omitempty"`
SealedTime uint64 `protobuf:"varint,6,opt,name=sealed_time,json=sealedTime,proto3" json:"sealed_time,omitempty"`
FlushedTime uint64 `protobuf:"varint,7,opt,name=flushed_time,json=flushedTime,proto3" json:"flushed_time,omitempty"`
@ -1124,11 +1124,11 @@ func (m *SegmentInfo) GetPartitionID() int64 {
return 0
}
func (m *SegmentInfo) GetInsertChannels() []string {
func (m *SegmentInfo) GetInsertChannel() string {
if m != nil {
return m.InsertChannels
return m.InsertChannel
}
return nil
return ""
}
func (m *SegmentInfo) GetOpenTime() uint64 {
@ -1732,109 +1732,109 @@ func init() {
func init() { proto.RegisterFile("data_service.proto", fileDescriptor_3385cd32ad6cfe64) }
var fileDescriptor_3385cd32ad6cfe64 = []byte{
// 1631 bytes of a gzipped FileDesc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0xe0, 0x5c, 0xdd, 0x23, 0xef, 0x48, 0xb5,
0x90, 0x59, 0x89, 0x38, 0xfd, 0x89, 0x28, 0xb8, 0x30, 0x38, 0x2f, 0x51, 0xf5, 0x21, 0x2c, 0x87,
0x4d, 0xe3, 0xdd, 0xce, 0x5e, 0xa2, 0xee, 0x0e, 0xe4, 0x45, 0xac, 0x87, 0x36, 0x4f, 0xa9, 0xa0,
0xe8, 0x24, 0x4a, 0xa9, 0xa0, 0xd8, 0xc0, 0x30, 0x66, 0xb6, 0x7e, 0x9c, 0x85, 0xbc, 0x47, 0xbb,
0x82, 0x63, 0x5f, 0x65, 0x76, 0x0f, 0x61, 0x21, 0xfe, 0x60, 0x4c, 0xae, 0xd1, 0xc4, 0x47, 0x65,
0x1a, 0xff, 0x62, 0x98, 0xf7, 0x1f, 0x87, 0x92, 0x1c, 0x8d, 0xb3, 0x08, 0x3d, 0x7c, 0x3e, 0xa6,
0xe8, 0xdc, 0xfe, 0xf0, 0xf0, 0x83, 0x1e, 0xe5, 0x47, 0xc3, 0xb6, 0xf7, 0xcf, 0xe6, 0x29, 0xed,
0xf7, 0xe9, 0x29, 0x27, 0x9d, 0xa3, 0x4d, 0xb9, 0xeb, 0xff, 0x5d, 0xca, 0xb8, 0x4b, 0xdb, 0x43,
0x4e, 0xba, 0x9b, 0xfe, 0xb1, 0x37, 0x85, 0xaa, 0x4d, 0xcf, 0xdc, 0xa0, 0xdd, 0x9e, 0x13, 0xab,
0x3b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x41, 0xfa, 0x50, 0x93, 0x85, 0x19, 0x00, 0x00,
// 1627 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5b, 0x6f, 0x1b, 0x45,
0x14, 0xce, 0x66, 0xed, 0xd8, 0x3e, 0xbe, 0xc4, 0x9d, 0x5c, 0xea, 0xba, 0xa5, 0x4d, 0x17,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xf2, 0x22, 0xd6, 0x23, 0x87, 0xa5, 0x54, 0x50, 0x74, 0x12, 0xa5,
0x54, 0x50, 0x6c, 0x60, 0x18, 0x33, 0x1b, 0x3f, 0xcf, 0x42, 0x9e, 0xd3, 0xae, 0xe0, 0xd8, 0x97,
0x99, 0xdd, 0x7d, 0x98, 0x8f, 0x3f, 0x17, 0x93, 0x6b, 0x34, 0xf1, 0x49, 0x99, 0xc6, 0xbf, 0x26,
0x94, 0xfd, 0xa7, 0xa1, 0x24, 0x47, 0xe3, 0x24, 0x42, 0x0f, 0x1f, 0x8f, 0x29, 0x3a, 0x37, 0x3f,
0xde, 0xff, 0xa8, 0x4f, 0xd8, 0xc1, 0xa8, 0xc3, 0xff, 0x59, 0x3f, 0x26, 0x83, 0x01, 0x39, 0x66,
0xb8, 0x7b, 0xb0, 0x2e, 0x77, 0xbd, 0xdd, 0x23, 0x94, 0x79, 0xa4, 0x33, 0x62, 0xb8, 0xb7, 0xee,
0x1f, 0x7b, 0x5d, 0xa8, 0x5a, 0xe7, 0xe6, 0x86, 0x9d, 0xce, 0x9c, 0x58, 0xdd, 0xfe, 0x2f, 0x00,
0x00, 0xff, 0xff, 0x12, 0x7a, 0x41, 0x93, 0x83, 0x19, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -41,7 +41,7 @@ type collectionReplica interface {
getCollectionByID(collectionID UniqueID) (*Collection, error)
getCollectionByName(collectionName string) (*Collection, error)
hasCollection(collectionID UniqueID) bool
getVecFieldsByCollectionID(collectionID UniqueID) ([]int64, error)
getVecFieldsByCollectionID(collectionID UniqueID) (map[int64]string, error)
// partition
// Partition tags in different collections are not unique,
@ -175,7 +175,7 @@ func (colReplica *collectionReplicaImpl) hasCollection(collectionID UniqueID) bo
return false
}
func (colReplica *collectionReplicaImpl) getVecFieldsByCollectionID(collectionID UniqueID) ([]int64, error) {
func (colReplica *collectionReplicaImpl) getVecFieldsByCollectionID(collectionID UniqueID) (map[int64]string, error) {
colReplica.mu.RLock()
defer colReplica.mu.RUnlock()
@ -184,10 +184,10 @@ func (colReplica *collectionReplicaImpl) getVecFieldsByCollectionID(collectionID
return nil, err
}
vecFields := make([]int64, 0)
vecFields := make(map[int64]string)
for _, field := range col.Schema().Fields {
if field.DataType == schemapb.DataType_VECTOR_BINARY || field.DataType == schemapb.DataType_VECTOR_FLOAT {
vecFields = append(vecFields, field.FieldID)
vecFields[field.FieldID] = field.Name
}
}

View File

@ -29,7 +29,7 @@ func (s *Segment) buildIndex(collection *Collection) commonpb.Status {
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
}
func (s *Segment) dropIndex(fieldID int64) commonpb.Status {
func (s *Segment) dropIndex(fieldName string) commonpb.Status {
// WARN: Not support yet
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}

View File

@ -51,9 +51,10 @@ func (li *LoadIndexInfo) appendIndexParam(indexKey string, indexValue string) er
return nil
}
func (li *LoadIndexInfo) appendFieldInfo(fieldID int64) error {
func (li *LoadIndexInfo) appendFieldInfo(fieldName string, fieldID int64) error {
cFieldName := C.CString(fieldName)
cFieldID := C.long(fieldID)
status := C.AppendFieldInfo(li.cLoadIndexInfo, cFieldID)
status := C.AppendFieldInfo(li.cLoadIndexInfo, cFieldName, cFieldID)
errorCode := status.error_code
if errorCode != 0 {

View File

@ -1,64 +1,12 @@
package querynode
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
"github.com/zilliztech/milvus-distributed/internal/indexnode"
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
)
func genIndexBinarySet() ([][]byte, error) {
const (
msgLength = 1000
DIM = 16
)
indexParams := make(map[string]string)
indexParams["index_type"] = "IVF_PQ"
indexParams["index_mode"] = "cpu"
indexParams["dim"] = "16"
indexParams["k"] = "10"
indexParams["nlist"] = "100"
indexParams["nprobe"] = "10"
indexParams["m"] = "4"
indexParams["nbits"] = "8"
indexParams["metric_type"] = "L2"
indexParams["SLICE_SIZE"] = "4"
typeParams := make(map[string]string)
typeParams["dim"] = strconv.Itoa(DIM)
var indexRowData []float32
for n := 0; n < msgLength; n++ {
for i := 0; i < DIM; i++ {
indexRowData = append(indexRowData, float32(n*i))
}
}
index, err := indexnode.NewCIndex(typeParams, indexParams)
if err != nil {
return nil, err
}
err = index.BuildFloatVecIndexWithoutIds(indexRowData)
if err != nil {
return nil, err
}
// save index to minio
binarySet, err := index.Serialize()
if err != nil {
return nil, err
}
bytesSet := make([][]byte, 0)
for i := range binarySet {
bytesSet = append(bytesSet, binarySet[i].Value)
}
return bytesSet, nil
}
func TestLoadIndexInfo(t *testing.T) {
indexParams := make([]*commonpb.KeyValuePair, 0)
indexParams = append(indexParams, &commonpb.KeyValuePair{
@ -70,21 +18,19 @@ func TestLoadIndexInfo(t *testing.T) {
Value: "cpu",
})
indexBytes, err := genIndexBinarySet()
assert.NoError(t, err)
indexBytes := make([][]byte, 0)
indexValue := make([]byte, 10)
indexBytes = append(indexBytes, indexValue)
indexPaths := make([]string, 0)
indexPaths = append(indexPaths, "IVF")
indexPaths = append(indexPaths, "index-0")
loadIndexInfo, err := newLoadIndexInfo()
assert.Nil(t, err)
for _, indexParam := range indexParams {
err = loadIndexInfo.appendIndexParam(indexParam.Key, indexParam.Value)
assert.NoError(t, err)
loadIndexInfo.appendIndexParam(indexParam.Key, indexParam.Value)
}
err = loadIndexInfo.appendFieldInfo(0)
assert.NoError(t, err)
err = loadIndexInfo.appendIndex(indexBytes, indexPaths)
assert.NoError(t, err)
loadIndexInfo.appendFieldInfo("field0", 0)
loadIndexInfo.appendIndex(indexBytes, indexPaths)
deleteLoadIndexInfo(loadIndexInfo)
}

View File

@ -47,6 +47,7 @@ type loadService struct {
type loadIndex struct {
segmentID UniqueID
fieldID int64
fieldName string
indexPaths []string
}
@ -261,7 +262,7 @@ func (s *loadService) updateSegmentIndex(indexParams indexParam, bytesIndex [][]
if err != nil {
return err
}
err = loadIndexInfo.appendFieldInfo(l.fieldID)
err = loadIndexInfo.appendFieldInfo(l.fieldName, l.fieldID)
if err != nil {
return err
}
@ -421,9 +422,10 @@ func (s *loadService) loadIndexImmediate(segment *Segment, indexPaths []string)
if err != nil {
return err
}
for _, id := range vecFieldIDs {
for id, name := range vecFieldIDs {
l := &loadIndex{
segmentID: segment.ID(),
fieldName: name,
fieldID: id,
indexPaths: indexPaths,
}
@ -447,9 +449,10 @@ func (s *loadService) loadIndexDelayed(collectionID, segmentID UniqueID, indexPa
if err != nil {
return err
}
for _, id := range vecFieldIDs {
for id, name := range vecFieldIDs {
l := &loadIndex{
segmentID: segmentID,
fieldName: name,
fieldID: id,
indexPaths: indexPaths,
}
@ -484,18 +487,10 @@ func (s *loadService) getInsertBinlogPaths(segmentID UniqueID) ([]*internalpb2.S
return pathResponse.Paths, pathResponse.FieldIDs, nil
}
func (s *loadService) filterOutVectorFields(fieldIDs []int64, vectorFields []int64) []int64 {
containsFunc := func(s []int64, e int64) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}
func (s *loadService) filterOutVectorFields(fieldIDs []int64, vectorFields map[int64]string) []int64 {
targetFields := make([]int64, 0)
for _, id := range fieldIDs {
if !containsFunc(vectorFields, id) {
if _, ok := vectorFields[id]; !ok {
targetFields = append(targetFields, id)
}
}