Skip to content

Feature/strict mode search max batchsize#8469

Merged
JojiiOfficial merged 4 commits into
qdrant:devfrom
bhk97:feature/strict-mode-search-max-batchsize
Mar 26, 2026
Merged

Feature/strict mode search max batchsize#8469
JojiiOfficial merged 4 commits into
qdrant:devfrom
bhk97:feature/strict-mode-search-max-batchsize

Conversation

@bhk97

@bhk97 bhk97 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Added search_max_batchsize (based on issue #8392 )like we have upset_max_batchsize .
It limits the search during the strict mode if enabled. Test cases are added and code is formatted based on reference code.
if further changes are required please let me know

@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 070177c0-bb64-418a-a3a3-e70b302f52b6

📥 Commits

Reviewing files that changed from the base of the PR and between 17a9832 and ab298c4.

📒 Files selected for processing (6)
  • lib/collection/src/operations/verification/mod.rs
  • lib/storage/src/content_manager/collection_verification.rs
  • src/actix/api/discover_api.rs
  • src/actix/api/query_api.rs
  • src/actix/api/recommend_api.rs
  • src/common/strict_mode.rs

📝 Walkthrough

Walkthrough

Adds an optional search_max_batchsize field to strict-mode across layers: protobuf (collections.proto), gRPC structs, OpenAPI schema, segment types, and storage/API conversions. Propagates the field through StrictModeConfig ↔ StrictModeConfigOutput conversions and hashing. Enforces the new limit in batch search verification paths (SearchRequestBatch::check_strict_mode and various actix endpoints / internal verification calls), extends strict-mode diff application to include the field, and adds unit/integration tests validating search and upsert batch-size enforcement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • qdrant/qdrant issue 8392 — Implements addition and enforcement of search_max_batchsize in StrictModeConfig, matching this PR's functionality.

Possibly related PRs

  • qdrant/qdrant PR 6616 — Related changes to strict-mode checking infrastructure and CheckedTocProvider call sites.
  • qdrant/qdrant PR 6114 — Overlapping modifications to StrictModeConfig ↔ StrictModeConfigOutput conversions and segment type handling.
  • qdrant/qdrant PR 7294 — Related updates to StrictModeConfig diff application logic.

Suggested reviewers

  • timvisee
  • generall
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.42% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feature/strict mode search max batchsize' directly relates to the main change: adding a new search_max_batchsize configuration field to strict mode, analogous to the existing upsert_max_batchsize.
Description check ✅ Passed The description explains the core feature addition (search_max_batchsize for limiting search batch size in strict mode), references the related issue, mentions test cases, and notes code formatting adjustments.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bhk97

bhk97 commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

hey @agourlay I had implemented the feature with test cases, hope to hear the feedback from you regarding this feature.

@agourlay

agourlay commented Mar 24, 2026

Copy link
Copy Markdown
Member

Check the CI error, you need to regenerate the openapi spec

+ diff -Zwa ./docs/redoc/master/openapi.json ./docs/redoc/master/.diff.openapi.json
7792,7798d7791
<           "search_max_batchsize": {
<             "description": "Max batchsize when searching",
<             "type": "integer",
<             "format": "uint",
<             "minimum": 0,
<             "nullable": true
<           },
10438,10444d10430
<             "type": "integer",
<             "format": "uint",
<             "minimum": 0,
<             "nullable": true
<           },
<           "search_max_batchsize": {
<             "description": "Max batchsize when searching",
+ set +x
ERROR: Generated OpenAPI files are not consistent with files in this repository, see diff above.
ERROR: See: https://github.com/qdrant/qdrant/blob/master/docs/DEVELOPMENT.md#rest

You just run and commit the change for

./tools/generate_openapi_models.sh

@bhk97

bhk97 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

hi @agourlay committed the change as per you asked. Please have a look at it.

@agourlay agourlay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@agourlay agourlay force-pushed the feature/strict-mode-search-max-batchsize branch from 16e66f7 to 17a9832 Compare March 26, 2026 10:09

@agourlay agourlay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty to rebase the PR and realized that I don't think the current implementation is perfect.

We have check_strict_mode_batch to handle all batched search APIs.

e.g.:

  • query_batch
  • recommend_batch
  • discovery_batch
  • search_batch

This PR only tackles search_batch by making it different from all other batched APIs.

I think a better approach is the improve check_strict_mode_batch so it checks the count of operations for all APIs.

@agourlay agourlay requested a review from JojiiOfficial March 26, 2026 11:35
@agourlay

Copy link
Copy Markdown
Member

@JojiiOfficial please review with my extra commit :)

@JojiiOfficial JojiiOfficial merged commit fb704e5 into qdrant:dev Mar 26, 2026
15 checks passed
generall pushed a commit that referenced this pull request Mar 26, 2026
* feat: add search_max_batchsize to strict mode config

* added test case for search_max_batchsize

* Changes for fixing CI issue dure openapi

* Modify check_strict_mode_batch

---------

Co-authored-by: Arnaud Gourlay <[email protected]>
KShivendu pushed a commit that referenced this pull request Mar 30, 2026
* feat: add search_max_batchsize to strict mode config

* added test case for search_max_batchsize

* Changes for fixing CI issue dure openapi

* Modify check_strict_mode_batch

---------

Co-authored-by: Arnaud Gourlay <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants