milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
30.06k stars 2.88k forks source link

[Bug]: flaky test case test_compact_max_time_interval in ci #37034

Open zhuwenxing opened 1 hour ago

zhuwenxing commented 1 hour ago

Is there an existing issue for this?

Environment

- Milvus version:
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

[pytest : test] self = <test_compaction.TestCompactionParams object at 0x7f74cd4a8550>

[pytest : test] 

[pytest : test]     @pytest.mark.tags(CaseLabel.L1)

[pytest : test]     def test_compact_max_time_interval(self):

[pytest : test]         """

[pytest : test]         target: test auto compact with max interval 60s

[pytest : test]         method: 1.create with shard_num=1

[pytest : test]                 2.insert flush twice (two segments)

[pytest : test]                 3.wait max_compaction_interval (60s)

[pytest : test]         expected: Verify compaction results

[pytest : test]         """

[pytest : test]         # create collection shard_num=1, insert 2 segments, each with tmp_nb entities

[pytest : test]         collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix), shards_num=1)

[pytest : test]         collection_w.create_index(ct.default_float_vec_field_name, ct.default_index)

[pytest : test]         collection_w.compact()

[pytest : test]     

[pytest : test]         # Notice:The merge segments compaction triggered by max_compaction_interval also needs to meet

[pytest : test]         # the compaction_segment_ num_threshold

[pytest : test]         for i in range(ct.compact_segment_num_threshold):

[pytest : test]             df = cf.gen_default_dataframe_data(tmp_nb)

[pytest : test]             collection_w.insert(df)

[pytest : test]             assert collection_w.num_entities == tmp_nb * (i + 1)

[pytest : test]     

[pytest : test]         sleep(ct.max_compaction_interval + 1)

[pytest : test]     

[pytest : test]         # verify queryNode load the compacted segments

[pytest : test]         collection_w.load()

[pytest : test]         replicas = collection_w.get_replicas()[0]

[pytest : test]         replica_num = len(replicas.groups)

[pytest : test]         cost = 180

[pytest : test]         start = time()

[pytest : test]         while time() - start < cost:

[pytest : test]             sleep(1.0)

[pytest : test]             collection_w.load()

[pytest : test]             segment_info = self.utility_wrap.get_query_segment_info(collection_w.name)[0]

[pytest : test]             if len(segment_info) == 1*replica_num:

[pytest : test]                 break

[pytest : test]             if time() - start > cost:

[pytest : test] >               raise MilvusException(1, f"Waiting more than {cost}s for the compacted segment indexed")

[pytest : test] E               pymilvus.exceptions.MilvusException: <MilvusException: (code=1, message=Waiting more than 180s for the compacted segment indexed)>

[pytest : test] 

[pytest : test] testcases/test_compaction.py:402: MilvusException

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [FieldSchema] args: ['int64', <DataType.INT64: 5>, ''], kwargs: {'is_primary': False, 'is_partition_key': False, 'nullable': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'name': 'int64', 'description': '', 'type': <DataType.INT64: 5>}  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [FieldSchema] args: ['varchar', <DataType.VARCHAR: 21>, ''], kwargs: {'max_length': 65535, 'is_primary': False, 'is_partition_key': False, 'nullable': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'name': 'varchar', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 65535}}  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [FieldSchema] args: ['float_vector', <DataType.FLOAT_VECTOR: 101>, ''], kwargs: {'dim': 128, 'is_primary': False, 'nullable': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'name': 'float_vector', 'description': '', 'type': <DataType.FLOAT_VECTOR: 101>, 'params': {'dim': 128}}  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [FieldSchema] args: ['float', <DataType.FLOAT: 10>, ''], kwargs: {'is_primary': False, 'nullable': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'name': 'float', 'description': '', 'type': <DataType.FLOAT: 10>}  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [FieldSchema] args: ['json_field', <DataType.JSON: 23>, ''], kwargs: {'is_primary': False, 'nullable': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'name': 'json_field', 'description': '', 'type': <DataType.JSON: 23>}  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [CollectionSchema] args: [[{'name': 'int64', 'description': '', 'type': <DataType.INT64: 5>}, {'name': 'float', 'description': '', 'type': <DataType.FLOAT: 10>}, {'name': 'varchar', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 65535}}, {'name': 'json_field', 'description': '', 'type': <DataTyp......, kwargs: {'primary_field': 'int64', 'auto_id': False, 'enable_dynamic_field': False} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : {'auto_id': False, 'description': '', 'fields': [{'name': 'int64', 'description': '', 'type': <DataType.INT64: 5>, 'is_primary': True, 'auto_id': False}, {'name': 'float', 'description': '', 'type': <DataType.FLOAT: 10>}, {'name': 'varchar', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params......  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [Connections.has_connection] args: ['default'], kwargs: {} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : False  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [Connections.connect] args: ['default', '', '', 'default', ''], kwargs: {'host': 'mskm-36693-11-py-pr-milvus.milvus-ci', 'port': '19530'} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:05 - DEBUG - ci_test]: (api_request)  : [Collection] args: ['compact_J6a6rFVK', {'auto_id': False, 'description': '', 'fields': [{'name': 'int64', 'description': '', 'type': <DataType.INT64: 5>, 'is_primary': True, 'auto_id': False}, {'name': 'float', 'description': '', 'type': <DataType.FLOAT: 10>}, {'name': 'varchar', 'description': '', 'type': <DataType......., kwargs: {'shards_num': 1, 'consistency_level': 'Strong'} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:06 - DEBUG - ci_test]: (api_response) : <Collection>:

[pytest : test] -------------

[pytest : test] <name>: compact_J6a6rFVK

[pytest : test] <description>: 

[pytest : test] <schema>: {'auto_id': False, 'description': '', 'fields': [{'name': 'int64', 'description': '', 'type': <DataType.INT64: 5>, 'is_primary': True, 'auto_id': False}, {'name': 'float', 'description': '', 'type': <DataType.FLOAT: 10>},......  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:06 - DEBUG - ci_test]: (api_request)  : [Collection.create_index] args: ['float_vector', {'index_type': 'IVF_SQ8', 'metric_type': 'COSINE', 'params': {'nlist': 128}}, 1200], kwargs: {'index_name': ''} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:06 - DEBUG - ci_test]: (api_response) : Status(code=0, message=)  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:06 - DEBUG - ci_test]: (api_request)  : [Collection.compact] args: [False, 180], kwargs: {} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:07 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:07 - DEBUG - ci_test]: (api_request)  : [Collection.insert] args: [    int64  float varchar                     json_field                                       float_vector

[pytest : test] 0       0    0.0       0    {'number': 0, 'float': 0.0}  [0.12485114444382907, 0.05894534531434381, 0.1...

[pytest : test] 1       1    1.0       1    {'number': 1, 'float': 1.0}  [0.09665547668794602, 0.1448......, kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:07 - DEBUG - ci_test]: (api_response) : (insert count: 100, delete count: 0, upsert count: 0, timestamp: 453381384330018828, success count: 100, err count: 0  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:07 - DEBUG - ci_test]: (api_request)  : [Collection.flush] args: [], kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:10 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:10 - DEBUG - ci_test]: (api_request)  : [Collection.insert] args: [    int64  float varchar                     json_field                                       float_vector

[pytest : test] 0       0    0.0       0    {'number': 0, 'float': 0.0}  [0.03126533986904592, 0.10452419968156251, 0.0...

[pytest : test] 1       1    1.0       1    {'number': 1, 'float': 1.0}  [0.06861939802768963, 0.0331......, kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:10 - DEBUG - ci_test]: (api_response) : (insert count: 100, delete count: 0, upsert count: 0, timestamp: 453381385169141762, success count: 100, err count: 0  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:10 - DEBUG - ci_test]: (api_request)  : [Collection.flush] args: [], kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:18 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:18 - DEBUG - ci_test]: (api_request)  : [Collection.insert] args: [    int64  float varchar                     json_field                                       float_vector

[pytest : test] 0       0    0.0       0    {'number': 0, 'float': 0.0}  [0.11505899740671524, 0.07508403034222286, 0.0...

[pytest : test] 1       1    1.0       1    {'number': 1, 'float': 1.0}  [0.01064283766353273, 0.1200......, kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:18 - DEBUG - ci_test]: (api_response) : (insert count: 100, delete count: 0, upsert count: 0, timestamp: 453381387344674817, success count: 100, err count: 0  (api_request.py:37)

[pytest : test] [2024-10-21 12:12:18 - DEBUG - ci_test]: (api_request)  : [Collection.flush] args: [], kwargs: {'timeout': 180} (api_request.py:62)

[pytest : test] [2024-10-21 12:12:29 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:13:30 - DEBUG - ci_test]: (api_request)  : [Collection.load] args: [None, 1, 180], kwargs: {} (api_request.py:62)

[pytest : test] [2024-10-21 12:13:33 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

[pytest : test] [2024-10-21 12:13:33 - DEBUG - ci_test]: (api_request)  : [Collection.get_replicas] args: [180], kwargs: {} (api_request.py:62)

[pytest : test] [2024-10-21 12:13:33 - DEBUG - ci_test]: (api_response) : Replica groups:

[pytest : test] - Group: <group_id:453380896308069219>, <group_nodes:(1,)>, <shards:[Shard: <channel_name:by-dev-rootcoord-dml_3_453380896156615110v0>, <shard_leader:1>, <shard_nodes:{1}>]>, <resource_group: __default_resource_group>, <num_outbound_node: {}>  (api_request.py:37)

[pytest : test] [2024-10-21 12:13:34 - DEBUG - ci_test]: (api_request)  : [Collection.load] args: [None, 1, 180], kwargs: {} (api_request.py:62)

[pytest : test] [2024-10-21 12:13:34 - DEBUG - ci_test]: (api_response) : None  (api_request.py:37)

Anything else?

failed ci job: https://jenkins.milvus.io:18080/blue/organizations/jenkins/Milvus%20HA%20CI/detail/PR-36693/11/pipeline/131

zhuwenxing commented 1 hour ago

/assign @XuanYang-cn