Skip to content

storage: budget MySQL snapshot partition probing by table size - #38090

Draft
peterdukelarsen wants to merge 1 commit into
pl/mysql-snapshot-prefix-partitionfrom
pl/mysql-partition-request-budget
Draft

storage: budget MySQL snapshot partition probing by table size#38090
peterdukelarsen wants to merge 1 commit into
pl/mysql-snapshot-prefix-partitionfrom
pl/mysql-partition-request-budget

Conversation

@peterdukelarsen

@peterdukelarsen peterdukelarsen commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Bounds the partitioner's probe traffic with a request budget derived from the table's estimated row count, via the new mysql_source_snapshot_partition_requests_per_billion_rows dyncfg (floored at 256 requests). When the budget runs out the walk stops splitting and emits coarser partitions, so cost is capped without losing correctness. The budget also serves as the hard bound on the walk for degenerate key spaces.

Adds mock tests for budget-bounded probing and for termination on non-advancing prefixes.

🤖 Generated with Claude Code

@peterdukelarsen peterdukelarsen changed the title pl/mysql partition request budget storage: budget MySQL snapshot partition probing by table size Aug 6, 2026
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch from 437fc36 to 6ae6b86 Compare August 6, 2026 20:11
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch from 6ae6b86 to 62cf41b Compare August 6, 2026 23:31
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch 2 times, most recently from d391fe2 to 51bc750 Compare August 7, 2026 00:05
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch 2 times, most recently from 0545c4e to a3d533a Compare August 7, 2026 22:27
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch 2 times, most recently from 453cc7f to c9bbea1 Compare August 8, 2026 00:08
Bound the prefix partitioner to a per-table probe query budget scaled
to the estimated row count, 2500 requests per billion rows by default
via the mysql_source_snapshot_partition_requests_per_billion_rows
dyncfg, with a floor of 256 so small tables can afford their handful
of splits. Probes run sequentially, so this caps the wall-clock that
partitioning can add to snapshot start in proportion to the snapshot
work it optimizes. An exhausted budget stops splitting early and
leaves coarser buckets, never incorrect ones.

Adds a mock test asserting the partitioner never exceeds its budget
and still returns a valid ordered boundary list when truncated.
@peterdukelarsen
peterdukelarsen force-pushed the pl/mysql-partition-request-budget branch from c9bbea1 to 1b2ebf2 Compare August 8, 2026 01:44
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