Skip to content

docs: cover the whole hex alphabet in the parallelScan example (#827) - #1045

Open
s2x wants to merge 1 commit into
masterfrom
docs/issue-827-docs-advanced-md-parallelscan-ends-its-l
Open

s2x wants to merge 1 commit into
masterfrom
docs/issue-827-docs-advanced-md-parallelscan-ends-its-l

Conversation

@s2x

@s2x s2x commented Nov 8, 2026

Copy link
Copy Markdown
Member

Closes #827

The last range ended at ';' (0x3B). With three or more workers that made the
last range reversed, so RawKvScanner::batchScan() rejected the whole call with
InvalidArgumentException through RegionRangeClipper::assertForwardRangeOrder()
(before that validation the clipper would have skipped the range); with one or
two workers the last range was valid but stopped at ';', silently covering only
the 0-9 buckets. The float step strlen($chars) / $workers also made
$chars[$i * $step] warn and truncate the offset for worker counts that do not
divide 16.

Boundaries now come from intdiv(), workers is clamped to 1..16, and the last
range ends at $prefix . 'g'. ParallelScanDocumentationGuardTest evaluates the
documented function for every worker count from 1 to 16 under a
warning-to-exception handler and asserts the ranges are non-empty, contiguous
and cover each bucket exactly once.
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.

docs/advanced.md parallelScan() ends its last range at ';' and skips keys c-f

1 participant