From 707a6a366e9f76ba7e25841547fec00347b50a21 Mon Sep 17 00:00:00 2001 From: bigsheeper Date: Wed, 2 Dec 2020 17:13:16 +0800 Subject: [PATCH] Fix issue about collection cannot be found Signed-off-by: bigsheeper --- internal/core/src/segcore/collection_c.cpp | 3 +++ internal/querynode/collection_replica.go | 3 +++ internal/querynode/meta_service.go | 14 +++++++------- tests/python/test_search.py | 7 ------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/internal/core/src/segcore/collection_c.cpp b/internal/core/src/segcore/collection_c.cpp index 07e0b63ebe..ee661e6f02 100644 --- a/internal/core/src/segcore/collection_c.cpp +++ b/internal/core/src/segcore/collection_c.cpp @@ -19,6 +19,9 @@ NewCollection(const char* collection_proto) { auto collection = std::make_unique(proto); + // TODO: delete print + std::cout << "create collection " << collection->get_collection_name() << std::endl; + return (void*)collection.release(); } diff --git a/internal/querynode/collection_replica.go b/internal/querynode/collection_replica.go index 68c2502048..85e3370bd7 100644 --- a/internal/querynode/collection_replica.go +++ b/internal/querynode/collection_replica.go @@ -12,6 +12,7 @@ package querynode */ import "C" import ( + "fmt" "github.com/zilliztech/milvus-distributed/internal/proto/internalpb" "log" "strconv" @@ -229,6 +230,7 @@ func (colReplica *collectionReplicaImpl) addPartitionsByCollectionMeta(colMeta * if err != nil { log.Println(err) } + fmt.Println("add partition: ", tag) } return nil @@ -262,6 +264,7 @@ func (colReplica *collectionReplicaImpl) removePartitionsByCollectionMeta(colMet if err != nil { log.Println(err) } + fmt.Println("delete partition: ", tag) } return nil diff --git a/internal/querynode/meta_service.go b/internal/querynode/meta_service.go index 1a51a31891..55623282c0 100644 --- a/internal/querynode/meta_service.go +++ b/internal/querynode/meta_service.go @@ -145,7 +145,7 @@ func printSegmentStruct(obj *etcdpb.SegmentMeta) { } func (mService *metaService) processCollectionCreate(id string, value string) { - println(fmt.Sprintf("Create Collection:$%s$", id)) + //println(fmt.Sprintf("Create Collection:$%s$", id)) col := mService.collectionUnmarshal(value) if col != nil { @@ -163,7 +163,7 @@ func (mService *metaService) processCollectionCreate(id string, value string) { } func (mService *metaService) processSegmentCreate(id string, value string) { - println("Create Segment: ", id) + //println("Create Segment: ", id) seg := mService.segmentUnmarshal(value) if !isSegmentChannelRangeInQueryNodeChannelRange(seg) { @@ -182,7 +182,7 @@ func (mService *metaService) processSegmentCreate(id string, value string) { } func (mService *metaService) processCreate(key string, msg string) { - println("process create", key) + //println("process create", key) if isCollectionObj(key) { objID := GetCollectionObjID(key) mService.processCollectionCreate(objID, msg) @@ -214,7 +214,7 @@ func (mService *metaService) processSegmentModify(id string, value string) { } func (mService *metaService) processCollectionModify(id string, value string) { - println("Modify Collection: ", id) + //println("Modify Collection: ", id) col := mService.collectionUnmarshal(value) if col != nil { @@ -242,7 +242,7 @@ func (mService *metaService) processModify(key string, msg string) { } func (mService *metaService) processSegmentDelete(id string) { - println("Delete segment: ", id) + //println("Delete segment: ", id) var segmentID, err = strconv.ParseInt(id, 10, 64) if err != nil { @@ -257,7 +257,7 @@ func (mService *metaService) processSegmentDelete(id string) { } func (mService *metaService) processCollectionDelete(id string) { - println("Delete collection: ", id) + //println("Delete collection: ", id) var collectionID, err = strconv.ParseInt(id, 10, 64) if err != nil { @@ -272,7 +272,7 @@ func (mService *metaService) processCollectionDelete(id string) { } func (mService *metaService) processDelete(key string) { - println("process delete") + //println("process delete") if isCollectionObj(key) { objID := GetCollectionObjID(key) diff --git a/tests/python/test_search.py b/tests/python/test_search.py index e883d930ae..3b546d15f3 100644 --- a/tests/python/test_search.py +++ b/tests/python/test_search.py @@ -146,7 +146,6 @@ class TestSearchBase: yield request.param # PASS - @pytest.mark.skip("should pass") def test_search_flat(self, connect, collection, get_top_k, get_nq): ''' target: test basic search function, all the search params is corrent, change top-k value @@ -599,7 +598,6 @@ class TestSearchBase: res = connect.search(collection_name, default_query) # PASS - @pytest.mark.skip("should pass") def test_search_distance_l2(self, connect, collection): ''' target: search collection, and check the result: distance @@ -850,7 +848,6 @@ class TestSearchBase: # PASS @pytest.mark.level(2) @pytest.mark.timeout(30) - @pytest.mark.skip("should pass") def test_search_concurrent_multithreads(self, connect, args): ''' target: test concurrent search with multiprocessess @@ -886,7 +883,6 @@ class TestSearchBase: # PASS @pytest.mark.level(2) @pytest.mark.timeout(30) - @pytest.mark.skip("should pass") def test_search_concurrent_multithreads_single_connection(self, connect, args): ''' target: test concurrent search with multiprocessess @@ -920,7 +916,6 @@ class TestSearchBase: # PASS @pytest.mark.level(2) - @pytest.mark.skip("should pass") def test_search_multi_collections(self, connect, args): ''' target: test search multi collections of L2 @@ -1011,7 +1006,6 @@ class TestSearchDSL(object): res = connect.search(collection, query) # PASS - @pytest.mark.skip("should pass") def test_query_vector_only(self, connect, collection): entities, ids = init_data(connect, collection) res = connect.search(collection, default_query) @@ -1318,7 +1312,6 @@ class TestSearchDSL(object): # PASS @pytest.mark.level(2) - @pytest.mark.skip("should pass") def test_query_range_invalid_ranges(self, connect, collection): ''' method: build query with invalid ranges