Repository navigation
Conversation
zzylol
force-pushed
the
fix/otlp-ingest-conformance
branch
from
November 28, 2026 05:56
c2de050 to
d5c576b
Compare
zzylol
force-pushed
the
chore/layout-cleanups
branch
from
November 28, 2026 05:56
0062957 to
5832a74
Compare
…yOutcome as Result - common::MAX_RANGE_STEPS (11,000, as Prometheus) is the one constant: the Prometheus routes' RangeQuery::parse refuses a longer range with 400, and ExecutorQueryEngine::execute, which had no cap, now refuses it with an error before running any step. (The ClickHouse and Elasticsearch routes call execute with instant queries only today.) - control_plane::test_support::one_query_plan (feature test-support, enabled by dev-dependencies only) replaces the copies in data-plane, query and precompute. - QueryDispatcher returns Result<T, NotAnswerableReason>; QueryOutcome had the same two cases. - common/tests/trait_shapes.rs deleted: it only checked that FallbackClient is object safe, which the data plane's Arc<dyn FallbackClient> fields already check at compile time.
zzylol
force-pushed
the
chore/layout-cleanups
branch
from
November 28, 2026 13:05
5832a74 to
b192642
Compare
This was referenced Nov 28, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExecutorQueryEngine::execute(the query engine'sQueryRequestentry point, which the ClickHouse and Elasticsearch routes use) had no range step cap. AQueryEval::Rangefrom 0 to 11,001 s at a 1 s step was evaluated at 11,002 step times (11,001 steps after the start), while the Prometheus routes refuse anything over 11,000 steps.QueryOutcome<T>repeatedResult.common::MAX_RANGE_STEPS(11,000) is the one constant. Both the Prometheus routes'RangeQuery::parseandexecuterefuse a longer range.control_plane::test_support::one_query_plan(dev-dependency featuretest-support) replaces the three copies.QueryDispatcherreturnsResult<T, NotAnswerableReason>.common/tests/trait_shapes.rsis deleted.exceeded maximum resolution of 11000 points per timeseriesbefore any step runs. Answers and/metricsare otherwise byte-identical to fix(otlp): OTLP/HTTP replies, Prometheus resource-attribute labels, DELTA sums rejected, in-place decoder #887 (parity dump).Review guide
fix/otlp-ingest-conformance(fix(otlp): OTLP/HTTP replies, Prometheus resource-attribute labels, DELTA sums rejected, in-place decoder #887), on top of chore: pin ASAPPlanner 566b35c and its asap_sketchlib d050037 (view format 5) #886. This is a stacked draft.crates/query/src/engine.rsExecutorQueryEngine::execute(the step checks, now before the install lookup), and its test.QueryOutcome::Ready/NotAnswerablebecomeOk/Errincrates/data-plane/src/{dispatcher,lib}.rs.crates/control-plane/src/test_support.rs; the call sites indata-plane(installer.rs,dispatcher.rs; the oldplandeleted fromtest_support.rs),query(engine.rs) andprecompute(engine.rs);features = ["test-support"]on the threecontrol_planedev-dependencies.Behavior: before → after
ExecutorQueryEngine::executewithQueryEval::Range { start_ms: 0, end_ms: 11_001_000, step_ms: 1_000 }for a planned PromQL queryNotReadywhile data is missing)Err(QueryEngineError { message: "exceeded maximum resolution of 11000 points per timeseries" })at onceend_ms: 11_000_000(11,000 steps after the start)executewithstep_ms: 0, before a plan is installedOk(NotReady)Err("range step 0 ms is not positive")(the check moved before the install lookup)GET /api/v1/query_rangeover 11,000 stepsbad_datacommon::MAX_RANGE_STEPS)Today no HTTP route reaches the new check. The ClickHouse and Elasticsearch routes send
executeinstant queries only, and the Prometheus routes call the dispatcher'srangeafterRangeQuery::parsehas already applied the cap. The check guards the engine's publicQueryRequestinterface, so a range sent by a future protocol route cannot run unbounded.Interfaces
crates/common/src/lib.rscrates/adapters/query/prometheus-http/src/lib.rs-const MAX_RANGE_STEPS: i64 = 11_000;crates/control-plane/src/test_support.rs,Cargo.tomlcrates/data-plane/src/dispatcher.rs(crate-private, exceptdispatch)QueryOutcomehad exactlyResult's two cases. WithResult,map_err(NotAnswerableReason::new)replaces two hand-written matches, andanswer_rangeuses?.Removed:
crates/common/tests/trait_shapes.rsandcommon'stokiodev-dependency. The test implementedFallbackClienton a fake and called it throughArc<dyn FallbackClient>. The data plane'sclickhouse_fallbackandelastic_fallbackfields areOption<Arc<dyn FallbackClient>>holding the adapters' real implementations, so object safety and implementing the trait outsidecommonare still checked at compile time.Usage (
crates/query/src/engine.rs::the_query_engine_installs_once_and_reports_not_ready, run at this commit):Algorithm changes
None.
Decisions and open questions
commonnext toMAX_TIME_MSand is shared, not duplicated.control_plane, which every caller already has as a dev-dependency and which ownsplan_workload, behind a feature so production builds do not compile it. A separate test-support crate was rejected: it would only re-exportcontrol_plane.Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked(ulimit -n 65536)b192642, rebased onto #887f895b85, which fixes the flakyingest_shards::a_shard_running_ahead_does_not_close_windows_early; see #887 "Flaky test fixed")the_fallback_client_is_usable_as_a_trait_object(deleted)b192642vs #887f895b85)Test first: the new assertions in
the_query_engine_installs_once_and_reports_not_readyfail on the base, becauseexecutereturnedOk(NotReady)for the 11,001-step range (unwrap_errpanicked).Follow-ups
executestill answers a range whose end is before its start with an empty matrix, whereRangeQuery::parserefuses it with 400. This predates this PR; left as is.