From 2ec159de9356f8ea95759d3068f5a2084f0a4a99 Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Wed, 20 Nov 2019 15:00:41 +0800 Subject: [PATCH 1/6] [skip ci] update changlog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42d5b8978f..7695704237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#127 - Support new Index type IVFPQ - \#226 - Experimental shards middleware for Milvus - \#346 - Support build index with multiple gpu +- \#420 - Update shards merge part to match v0.5.3 ## Improvement - \#275 - Rename C++ SDK IndexType From 5a27642a514e08fb63804364cfbc76f11950d05b Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Mon, 25 Nov 2019 15:02:51 +0800 Subject: [PATCH 2/6] fix test case bug --- tests/milvus_python_test/test_add_vectors.py | 3 ++- tests/milvus_python_test/test_index.py | 10 +++++++++- tests/milvus_python_test/utils.py | 12 ++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/milvus_python_test/test_add_vectors.py b/tests/milvus_python_test/test_add_vectors.py index 7245d51ea2..7c9d9e691c 100644 --- a/tests/milvus_python_test/test_add_vectors.py +++ b/tests/milvus_python_test/test_add_vectors.py @@ -1300,7 +1300,8 @@ class TestNameInvalid(object): assert not status.OK() @pytest.mark.level(2) - def test_add_vectors_with_invalid_tag_name(self, connect, get_tag_name): + def test_add_vectors_with_invalid_tag_name(self, connect, get_table_name, get_tag_name): + table_name = get_table_name tag_name = get_tag_name vectors = gen_vectors(1, dim) status, result = connect.add_vectors(table_name, vectors, partition_tag=tag_name) diff --git a/tests/milvus_python_test/test_index.py b/tests/milvus_python_test/test_index.py index 39aadb9d33..108563691f 100644 --- a/tests/milvus_python_test/test_index.py +++ b/tests/milvus_python_test/test_index.py @@ -1209,8 +1209,16 @@ class TestCreateIndexParamsInvalid(object): logging.getLogger().info(index_params) status, ids = connect.add_vectors(table, vectors) # if not isinstance(index_type, int) or not isinstance(nlist, int): - with pytest.raises(Exception) as e: + try: status = connect.create_index(table, index_params) + assert not status.OK() + # no exception raised & status is OK. unexpected. + assert False + except (Exception, ): + pass + # with pytest.raises(Exception) as e: + # status = connect.create_index(table, index_params) + # assert not status.OK() # else: # status = connect.create_index(table, index_params) # assert not status.OK() diff --git a/tests/milvus_python_test/utils.py b/tests/milvus_python_test/utils.py index 159c8407c6..a0e60e5f9d 100644 --- a/tests/milvus_python_test/utils.py +++ b/tests/milvus_python_test/utils.py @@ -54,12 +54,12 @@ def gen_long_str(num): def gen_invalid_ips(): ips = [ - "255.0.0.0", - "255.255.0.0", - "255.255.255.0", - "255.255.255.255", - "127.0.0", - "123.0.0.2", + # "255.0.0.0", + # "255.255.0.0", + # "255.255.255.0", + # "255.255.255.255", + # "127.0.0", + # "123.0.0.2", "12-s", " ", "12 s", From 67d561dbea906fbd907e8e44b47b476d9a9c4099 Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Tue, 26 Nov 2019 10:28:38 +0800 Subject: [PATCH 3/6] comment urlplus uri --- tests/milvus_python_test/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/milvus_python_test/utils.py b/tests/milvus_python_test/utils.py index a0e60e5f9d..6cb63b36c4 100644 --- a/tests/milvus_python_test/utils.py +++ b/tests/milvus_python_test/utils.py @@ -114,12 +114,12 @@ def gen_invalid_uris(): # invalid ip "tcp:// :%s" % port, - "tcp://123.0.0.1:%s" % port, + # "tcp://123.0.0.1:%s" % port, "tcp://127.0.0:%s" % port, - "tcp://255.0.0.0:%s" % port, - "tcp://255.255.0.0:%s" % port, - "tcp://255.255.255.0:%s" % port, - "tcp://255.255.255.255:%s" % port, + # "tcp://255.0.0.0:%s" % port, + # "tcp://255.255.0.0:%s" % port, + # "tcp://255.255.255.0:%s" % port, + # "tcp://255.255.255.255:%s" % port, "tcp://\n:%s" % port, ] From 80608890fe80a46963b52d7b3b95404ae1dab112 Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Tue, 26 Nov 2019 10:50:02 +0800 Subject: [PATCH 4/6] update changlog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d1c5b6b1..c6090c6abd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#509 - IVF_PQ index build trapped into dead loop caused by invalid params - \#513 - Unittest DELETE_BY_RANGE sometimes failed - \#527 - faiss benchmark not compatible with faiss 1.6.0 +- \#532 - assigin value to `table_name` from confest shell ## Feature - \#12 - Pure CPU version for Milvus From 55b4acc27b564aad169622d9a5747b9e5b274ffc Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Tue, 26 Nov 2019 14:37:05 +0800 Subject: [PATCH 5/6] [skip ci]afix shards bug when serch result is empty --- shards/mishards/service_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shards/mishards/service_handler.py b/shards/mishards/service_handler.py index f192aff72c..297e349f45 100644 --- a/shards/mishards/service_handler.py +++ b/shards/mishards/service_handler.py @@ -61,6 +61,10 @@ class ServiceHandler(milvus_pb2_grpc.MilvusServiceServicer): return status, [], [] row_num = files_collection.row_num + # row_num is equal to 0, result is empty + if not row_num: + continue + ids = files_collection.ids diss = files_collection.distances # distance collections # TODO: batch_len is equal to topk, may need to compare with topk @@ -322,7 +326,7 @@ class ServiceHandler(milvus_pb2_grpc.MilvusServiceServicer): topk_result_list = milvus_pb2.TopKQueryResult( status=status_pb2.Status(error_code=status.error_code, reason=status.reason), - row_num=len(query_record_array), + row_num=len(id_results), ids=id_results, distances=dis_results) return topk_result_list From 006a480fc85d2648fc4c00957f2d6ffef8c6492a Mon Sep 17 00:00:00 2001 From: yhz <413554850@qq.com> Date: Tue, 26 Nov 2019 14:42:56 +0800 Subject: [PATCH 6/6] [skip ci] update changlog; fix #543 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17f64754ef..ef53ca57d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Please mark all change in change log and use the ticket from JIRA. - \#527 - faiss benchmark not compatible with faiss 1.6.0 - \#530 - BuildIndex stop when do build index and search simultaneously - \#532 - assigin value to `table_name` from confest shell +- \#543 - client raise exception in shards when search results is empty ## Feature - \#12 - Pure CPU version for Milvus