Skip to content

feat: let a range scan leave out the values - #487

Merged
mattisonchao merged 2 commits into
mainfrom
feat/range-scan-keys-only
Oct 28, 2026
Merged

mattisonchao merged 2 commits into
mainfrom
feat/range-scan-keys-only

Conversation

@mattisonchao

@mattisonchao mattisonchao commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Part of oxia-db/oxia#1759. Server side: oxia-db/oxia#1798.

Problem

list() is deprecated in favor of rangeScan() (#485), but a range scan returns the values too, so moving a caller from list() to rangeScan() transfers every value.

Change

  • RangeScanOption.IncludeValue(boolean), which returns the OptionIncludeValue of GetOption.IncludeValue. With false, the client sets include_values = false on the request, and the results have an empty value and the version of each record. With an index, they still have their secondary keys.
  • include_values is an optional bool in client.proto: unset means true, so the requests of older clients keep their values.
  • An older server ignores the field and sends the values, so the client drops them. No feature flag is needed.
  • The deprecation of list now points to rangeScan with IncludeValue(false).

Testing

  • AsyncOxiaClientImplTest.rangeScanWithoutValuesDropsTheValuesOfAnOlderServer: the request sets include_values = false only without the values, and the client drops the values a server sends anyway.
  • OptionsUtilsTest.includesValue: the values are included unless an option leaves them out.
  • OxiaClientIT.testRangeScanWithoutValues: against a server, the scan returns the keys and the versions with empty values.
  • ./gradlew spotlessApply build, including the integration tests: pass. check-coverage.py: 100% of lines (3636) and branches (1534).

AI Usage

Claude Code made the change, wrote the tests, ran the build, wrote this description and created the PR, at the contributor's request.

Signed-off-by: mattisonchao <qiang.zhao@streamnative.io>
Signed-off-by: mattisonchao <qiang.zhao@streamnative.io>
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant