Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: search iterator v2 fails to fallback because of ambiguous topK parameter #2539

Open
1 task done
qixuan0212 opened this issue Jan 2, 2025 · 3 comments
Open
1 task done
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@qixuan0212
Copy link

qixuan0212 commented Jan 2, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Use Milvus server version <= 2.5.1 and new pymilvus server from master/2.5.
2025-01-02 10:57:22,838 [WARNING][search_iterator]: The server does not support Search Iterator V2. The search_iterator (v1) is used instead. Please upgrade your Milvus server version to 2.5.2 and later, or use a pymilvus version before 2.5.3 (excluded) to avoid this issue. (milvus_client.py:603) 2025-01-02 10:57:22,881 [ERROR][handler]: RPC error: [search], <ParamError: (code=1, message=ambiguous parameter: topk, in search_param: 200, in search_param.params: 20)>, <Time:{'RPC start': '2025-01-02 10:57:22.880847', 'RPC error': '2025-01-02 10:57:22.881057'}> (decorators.py:140)

Expected Behavior

Fallback to search iterator v1 and be able to run.

Steps/Code To Reproduce behavior

@pytest.mark.tags(CaseLabel.L0)
    def test_milvus_client_search_iterator_default(self, search_params):
        """
        target: test search iterator (high level api) normal case
        method: create connection, collection, insert and search iterator
        expected: search iterator successfully
        """
        client = self._connect(enable_milvus_client_api=True)
        collection_name = cf.gen_unique_str(prefix)
        client_w.using_database(client, "default")
        # 1. create collection
        client_w.create_collection(client, collection_name, default_dim, consistency_level="Bounded")
        collections = client_w.list_collections(client)[0]
        assert collection_name in collections
        client_w.describe_collection(client, collection_name,
                                     check_task=CheckTasks.check_describe_collection_property,
                                     check_items={"collection_name": collection_name,
                                                  "dim": default_dim,
                                                  "consistency_level": 0})
        # 2. insert
        rng = np.random.default_rng(seed=19530)
        rows = [{default_primary_key_field_name: i, default_vector_field_name: list(rng.random((1, default_dim))[0]),
                 default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)]
        client_w.insert(client, collection_name, rows)
        client_w.flush(client, collection_name)
        # 3. search iterator
        vectors_to_search = rng.random((1, default_dim))
        insert_ids = [i for i in range(default_nb)]
        client_w.search_interator(client, collection_name, vectors_to_search, search_params=search_params,
                                  check_task=CheckTasks.check_search_iterator,
                                  check_items={"enable_milvus_client_api": True,
                                               "nq": len(vectors_to_search),
                                               "ids": insert_ids,
                                               "limit": default_limit})
        client_w.release_collection(client, collection_name)
        client_w.drop_collection(client, collection_name)

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory): CPU
- Method of installation (Docker, or from source):source
- Milvus version (v0.3.1, or v0.4.0): 2.5.1
- Milvus configuration (Settings you made in `server_config.yaml`):

Anything else?

N/A

@qixuan0212 qixuan0212 added the kind/bug Something isn't working label Jan 2, 2025
@qixuan0212
Copy link
Author

qixuan0212 commented Jan 2, 2025

/assign @smellthemoon

@PwzXxm
Copy link
Contributor

PwzXxm commented Jan 2, 2025

Fallback logic and V2 does not modify topk.
This may relate to #2537 and search iterator V1

@smellthemoon
Copy link
Contributor

related with #2540

@XuanYang-cn XuanYang-cn added this to the 2.5.3 milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants