milvus icon indicating copy to clipboard operation
milvus copied to clipboard

[Bug]: [Pagination] Search pagination with invalid offset value raised no exception

Open NicoYuan1986 opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Environment

- Milvus version:master-20220916-11b352c
- Deployment mode(standalone or cluster):standalone
- SDK version(e.g. pymilvus v2.0.0rc2):2.2.0.dev30
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Search pagination with invalid offset value raised no exception.

Expected Behavior

Return an error code. Such as ,MilvusException: (code=1, message=Invalid offset value, should be in range [...])

Steps To Reproduce

Run:

    @pytest.mark.tags(CaseLabel.L1)
    @pytest.mark.parametrize("offset", [-1, 16385])
    def test_search_with_invalid_offset_value(self, offset, auto_id, dim, _async):
        # 1. initialize
        collection_w = self.init_collection_general(prefix, True, auto_id=auto_id, dim=dim)[0]
        # 2. search
        search_param = {"metric_type": "L2", "params": {"nprobe": 10}, "offset": offset}
        vectors = [[random.random() for _ in range(dim)] for _ in range(default_nq)]
        collection_w.search(vectors[:default_nq], default_search_field,
                            search_param, default_limit,
                            default_search_exp, _async=_async,
                            check_task=CheckTasks.check_search_results,
                            check_items={"nq": default_nq,
                                         "limit": default_limit,
                                         "_async": _async})

Milvus Log

No response

Anything else?

No response

NicoYuan1986 avatar Sep 16 '22 09:09 NicoYuan1986

/assign @XuanYang-cn /unassign

yanliang567 avatar Sep 16 '22 09:09 yanliang567

/unassign /assign @NicoYuan1986 Please help verify

XuanYang-cn avatar Sep 28 '22 02:09 XuanYang-cn

/unassign /assign @NicoYuan1986 Please help verify

Thank you for your help! The issue has been well solved now.

NicoYuan1986 avatar Sep 28 '22 07:09 NicoYuan1986