anuragrai16 opened a new pull request, #18475: URL: https://github.com/apache/pinot/pull/18475
## [pinot-server/ proactive-query-killing] (2/2) Wire scan-based query killing into server operators and startup ### Summary - Instruments 11 query operators and `DocIdSetOperator` to push scan cost (`addDocsScanned` / `addEntriesScannedInFilter`) into the per-query `QueryScanCostContext` on every block iteration, enabling cooperative scan-based query killing at block boundaries - Wires `QueryKillingManager` into `BaseServerStarter` for singleton initialization and ZK cluster config change listener registration, so scan killing thresholds can be tuned live without server restart - Adds `requestId` throughout the kill report chain (`QueryKillingStrategy` → `QueryKillReport`) for end-to-end traceability in kill reports and customer error messages - Enhances `QueryKillingManager` with a 2-arg convenience overload called from `BaseOperator.checkTermination()`, `synchronized onChange()` for atomic config/strategy rebuilds, and `resolveQueryStrategy()` for per-query table-level override caching ### Design: Two-path kill check The scan-based killing integration has two cooperating paths: 1. **Cost accumulation** (per-operator): Each leaf operator pushes scan cost deltas into the shared `QueryScanCostContext` after each block. This is the instrumentation in the 11 operator files. 2. **Kill enforcement** (`BaseOperator.checkTermination()` / `checkTerminationAndSampleUsage()`): On every `nextBlock()` call across the operator tree, the killing manager evaluates whether accumulated cost exceeds thresholds and terminates the query if so. ### Test plan - [ ] **Unit tests pass** (54 tests): `QueryKillReportTest` (4), `QueryKillingManagerTest` (20, including 6 new), `QueryMonitorConfigScanKillingTest` (9), `CompositeQueryKillingStrategyTest` (8), `ScanEntriesThresholdStrategyTest` (13) [Functional testing plan on quick start for all scenarios](https://docs.google.com/document/d/1zqN6AgCpCXjkS3MsUlA5YMyzHrKes4rtq35oMjnfARQ/edit?tab=t.zcpkww1pjf2a) -- 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]
