Skip to content

feat(query): add test-only mode that disables external query forwarding - #751

Merged
zzylol merged 4 commits into
mainfrom
744-add-a-test-only-mode-that-disables-all-external-query-fallback
Sep 21, 2026
Merged

zzylol merged 4 commits into
mainfrom
744-add-a-test-only-mode-that-disables-all-external-query-fallback

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #744.

Why

Tests need to prove that a query is answered locally without silently reaching an external exact backend. Disabling --forward-unsupported-queries alone leaves planned exact subqueries and separately configured query listeners available.

Before this PR

A test process could disable the PromQL unsupported-query fallback, but a planned PromQL or MetricsQL exact subquery could still contact its configured backend.

After this PR

--disable-query-forwarding starts a test process that serves local queries and returns the normal local error when a query needs an external backend. Prometheus and VictoriaMetrics exact-subquery endpoints are disabled. Startup rejects this mode together with --forward-unsupported-queries, the asapquery profile, or a VictoriaMetrics or ClickHouse query listener. Ingestion, health checks, and runtime metadata are outside this query policy. Without the flag, existing behavior is unchanged.

Implementation

  • QueryForwardingPolicy removes adapter fallback clients and prevents planned exact-subquery HTTP calls.
  • Blocked HTTP fallback and planned exact-subquery attempts log at debug level and increment asap_query_forwarding_blocked_total.
  • Typed CLI validation rejects incompatible query-forwarding configuration at startup.

Verification

  • The production-process test starts data_plane with --disable-query-forwarding, sends instant and range queries, checks local error responses, and records zero requests at a capture server.
  • CLI tests cover incompatible flags, profile, and query listeners; an exact-subquery test verifies a missing endpoint fails closed.
  • The required MVP backend CI passed formatting, workspace checking, Clippy, and workspace tests.

@milindsrivastava1997 milindsrivastava1997 linked an issue Sep 21, 2026 that may be closed by this pull request
7 tasks
@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 21, 2026 15:02
@zzylol
zzylol force-pushed the 744-add-a-test-only-mode-that-disables-all-external-query-fallback branch from c688af6 to 460629d Compare September 21, 2026 16:02
@zzylol zzylol changed the title test: add query forwarding disable mode feat(query): add test-only mode that disables external query forwarding Sep 21, 2026
@zzylol
zzylol merged commit f8156e5 into main Sep 21, 2026
1 check passed
@zzylol
zzylol deleted the 744-add-a-test-only-mode-that-disables-all-external-query-fallback branch September 21, 2026 17:26
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.

Add a test-only mode that disables all external query fallback

2 participants