Skip to content

Fix VSIM COUNT when FILTER is set#1856

Merged
kevin-montrose merged 4 commits into
mainfrom
users/kmontrose/fixVectorSetFilterOverSelect
Jun 5, 2026
Merged

Fix VSIM COUNT when FILTER is set#1856
kevin-montrose merged 4 commits into
mainfrom
users/kmontrose/fixVectorSetFilterOverSelect

Conversation

@kevin-montrose

Copy link
Copy Markdown
Contributor

When FILTER is set on VSIM we over select to do post-filtering.

We were not correctly limiting the number of result returned, instead returning whatever matched from the over select.

This fixes that.

Copilot AI review requested due to automatic review settings June 5, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix VSIM response sizing when FILTER is present by ensuring the server returns at most the requested COUNT (instead of returning all post-filter matches from an over-select), and adds a regression test to cover COUNT behavior with/without FILTER and with WITHATTRIBS/WITHSCORES.

Changes:

  • Add VSIMCount test coverage validating result cardinality with COUNT, both with and without FILTER, and with WITHATTRIBS/WITHSCORES.
  • Update NetworkVSIM response building to cap the reported/returned results to COUNT when a filter bitmap is present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/standalone/Garnet.test.vectorset/RespVectorSetTests.cs Adds VSIMCount regression test (and BinaryPrimitives usage) to validate COUNT behavior under filtering and output flags.
libs/server/Resp/Vector/RespServerSessionVectors.cs Adjusts VSIM response sizing logic to cap results to COUNT when filtering is used, and changes iteration bounds accordingly.

Comment thread libs/server/Resp/Vector/RespServerSessionVectors.cs
Comment thread test/standalone/Garnet.test.vectorset/RespVectorSetTests.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread libs/server/Resp/Vector/RespServerSessionVectors.cs
@kevin-montrose kevin-montrose merged commit e410f85 into main Jun 5, 2026
146 checks passed
@kevin-montrose kevin-montrose deleted the users/kmontrose/fixVectorSetFilterOverSelect branch June 5, 2026 16:47
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