Repository navigation
Conversation
Follow-up review and qualification (2026-11-09)Decision: hold as draft. I don't recommend merging on current evidence. Defaults stay unchanged. The code review found no defects: leases are released on every path, shared state is preserved, and the unset path returns the shared context. So no code change was pushed. The open question is the benefit, not correctness. Run setup. One boat.dev large VM, now erased. Base and budget binaries were built from the same tree, toolchain and lockfile. The server was pinned to four CPUs, so the default target is 16. Data was a 1.5M-row, 101-column fixture on MinIO behind 25 ms of
At C8, floor 4 cost about 2.5% on selective aggregates, and the block ranges don't overlap. It gained 18% on the heavy What would justify merge: a representative production query mix in which CPU-bound concurrent queries (local, hot-tier or cached data) dominate, showing a repeatable net gain at a documented setting. Otherwise, consider closing. Focused tests pass (4/4, release). 🤖 Generated with Claude Code |
Document that HTTP, histogram SQL, alerts and Flight scans already use the budgeted executor; retain metadata and logical planning outside the lease. Add regression coverage for execution context participation and the unchanged shared-session default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Track active budgeted queries through lease ownership and record chosen partition targets. Register fixed-cardinality metrics consistently, document interpretation, and cover disabled and lease cleanup paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the default /metrics output unchanged: the two budget metrics are registered only when P_DATAFUSION_QUERY_PARTITION_BUDGET is configured. The registry is built after PARSEABLE options are initialized in main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing: no setting gives a net gainFollow-up qualification (2026-11-09) found no budget/floor setting that improves throughput without regressing remote queries. All checked responses matched independent oracles, and no correctness defects or lease leaks were found. The problem is benefit, not safety.
The budget only helps when every query is CPU-bound on local data. Choosing a safe setting needs per-query knowledge of where the data lives, which the planner doesn't have. Enterprise tenant routing and distributed exchange could not be tested in this checkout. The branch keeps the follow-up audit doc, regression tests and opt-in metrics ( 🤖 Generated with Claude Code |
Description
Add an experimental, opt-in advisory partition budget for newly executing queries. With
P_DATAFUSION_QUERY_PARTITION_BUDGETunset, execution retains the existing fixed target and explicit overrides.When enabled, select
min(target_partitions, max(min_query_partitions, budget / active_queries, 1))from an active-query snapshot. Clone the session state while retaining shared runtime, memory pool, stores, caches, tenant catalogs, UDFs, extensions and optimizer hooks. RAII leases cover collection and streaming workers/results, including errors, responsive timeouts and early drops.This is an advisory planning policy: existing queries are not resized, and it provides no aggregate admission cap, tenant quota, queuing or fairness guarantee. The explicit target remains the ceiling. The default is unchanged.
This draft is independent of severity clustering and the Flight metrics fix. It contains only the policy/configuration, focused tests, and
docs/query-partition-budget.md; no benchmark harnesses or result archives.Validation
Why this remains a draft
Benefits vary by workload. In the standalone policy campaign, local selective C8 throughput rose from 142.83 to 171.77 completed QPS, while controlled-S3 mixed C8 fell from 1.77 to 1.70. Those are three-block descriptive medians from finite batches against synthetic local/controlled-remote data, not sustained capacity or real-cloud evidence. Keep the setting unset pending representative qualification.
The standalone campaign could not qualify successful Flight delivery because of an inherited metrics panic. Successful Flight was separately exercised in the combined campaign after applying the independent fix. CPU-saturating preemption, enterprise tenant HTTP routing, distributed exchange, hot-tier runtime routing, spilling and memory-admission capacity remain unqualified.
This PR has:
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.