anuragrai16 opened a new pull request, #18102:
URL: https://github.com/apache/pinot/pull/18102
This PR introduces all core classes for a proactive, scan-cost-based query
killing framework. No existing query execution path is modified in this PR. A
follow-up PR will wire these into BaseOperator.checkTermination() and the
operator instrumentation points.
**New classes:**
- `QueryScanCostContext` (pinot-spi) — LongAdder-based, thread-safe
accumulator for numEntriesScannedInFilter, numDocsScanned, and
numEntriesScannedPostFilter. One instance per query, shared across segment
worker threads.
- `QueryKillingStrategy` (pinot-core) — Interface for pluggable kill
decisions. Includes shouldTerminate(), buildKillReport(),
getErrorCode(), and forQuery() for table-level threshold overrides.
- `ScanEntriesThresholdStrategy` (pinot-core) — Default strategy. Kills
queries exceeding maxEntriesScannedInFilter or maxDocsScanned.
Threshold of Long.MAX_VALUE disables that metric. Includes a nested
Factory that validates config at init and logs a warning if no
thresholds are set.
- `CompositeQueryKillingStrategy` (pinot-core) — Combines strategies with
AND/OR semantics.
- `QueryKillingStrategyFactory` (pinot-core) — Factory interface for
config-driven strategy loading. Custom strategies are plugged in by
setting accounting.scan.based.killing.strategy.factory.class.name to a
factory class
- `QueryKillReport` (pinot-core) — Immutable snapshot of a kill event.
Captures all metrics at creation time
Produces customer-facing error messages with actionable advice and
structured internal log messages.
- `QueryKillingManager` (pinot-core) — Singleton manager. Builds strategy
once at init via factory, delegates
shouldTerminate()/buildKillReport() to the strategy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]