Skip to content

docs: document scanIterator()/scanPrefixIterator() (#391) - #539

Merged
s2x merged 2 commits into
masterfrom
fix/391-doc-scan-iterators
Sep 9, 2026
Merged

docs: document scanIterator()/scanPrefixIterator() (#391)#539
s2x merged 2 commits into
masterfrom
fix/391-doc-scan-iterators

Conversation

@s2x

@s2x s2x commented Sep 9, 2026

Copy link
Copy Markdown
Member

Description

Documents RawKvClient::scanIterator() / scanPrefixIterator() (issue #391, audit finding DOC-25) — previously the only mention anywhere was a line in the README file tree, while the docs taught a hand-rolled ScanPaginator whose incrementKey() produced a smaller end key for 0xFF-terminated prefixes (silently empty scans).

All claims verified against src/Client/RawKv/ScanIterator.php, RawKvScanner.php and RawKvClient.php.

Closes #391

Changes

  • docs/operations.md: new Iterating Large Ranges subsection — both signatures (batchSize = 256 default, bounds 1 <= batchSize <= 10240 validated synchronously with InvalidArgumentException), keyOnly null-value behaviour, page/continuation mechanics (one page in memory, continues from lastKey . "\x00", exhausts on a short page), rewindable re-scan-from-start, lazy RPCs/exceptions during iteration, no reverse iterator; the manual pagination loop in the Scan section is replaced by the iterator.
  • docs/advanced.md: the hand-rolled ScanPaginator class is deleted and replaced with the built-in iterators, plus an explicit warning about the wrong chr($lastByte + 1) prefix-end arithmetic vs RawKvSplitter::calculatePrefixEndKey().
  • README.md: iterator examples in the Scanning section and a bullet under Implemented Operations → Scanning.
  • docs/troubleshooting.md: the 10240 scan-limit row now cross-references the iterators.
  • CHANGELOG.md: new ### Documentation entry under [Unreleased] ([DOC-25], [DOC-25] Document scanIterator() / scanPrefixIterator() #391).

Changelog

  • [DOC-25]: scanIterator() / scanPrefixIterator() documented in docs/operations.md (Iterating Large Ranges) with signatures, batchSize bounds (1..10240), keyOnly null values, page/continuation/rewind semantics and lazy-exception behaviour; the buggy hand-rolled ScanPaginator in docs/advanced.md and the manual pagination loop in docs/operations.md are replaced with the built-in iterators, cross-referenced from README and the troubleshooting scan-limit row. ([DOC-25] Document scanIterator() / scanPrefixIterator() #391)

Code Review

  • Pending subagent code review

@s2x s2x self-assigned this Sep 9, 2026
@s2x
s2x force-pushed the fix/391-doc-scan-iterators branch from b3f4888 to bdf509a Compare September 9, 2026 18:46
@s2x
s2x marked this pull request as ready for review September 9, 2026 18:46
@s2x
s2x merged commit 46c3c70 into master Sep 9, 2026
9 checks passed
@s2x
s2x deleted the fix/391-doc-scan-iterators branch September 9, 2026 18:48
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.

[DOC-25] Document scanIterator() / scanPrefixIterator()

1 participant