Vamsi-klu opened a new pull request, #19026: URL: https://github.com/apache/pinot/pull/19026
## Summary Adds **advisory sanity-check warnings** to realtime provisioning estimates (CLI + recommender JSON) and stops hiding over-host-memory matrix cells behind opaque `NA`. **Issue:** Fixes apache/pinot#8339 --- ## What is the problem? The Realtime Provisioning Helper / recommender rule can recommend multi‑GB segments or host/hour combinations whose active memory exceeds `-maxUsableHostMemory` without calling that out. Previously, over-memory cells were shown as **`NA`**, the same token used when `numHoursToConsume > retentionHours`, which: 1. Hid the actual computed estimate operators needed to judge risk. 2. Collapsed two different meanings into one opaque cell. 3. Gave no structured warning for large segments, high segments-per-host, or over-memory combos. Issue discussion converged on **warnings over hard limits** (large segments can be valid for huge volumes after conscious tradeoff). --- ## Why did I do this? Provisioning mistakes become production OOM, long consumption pauses, and upload timeouts. Advisory warnings preserve recommendation math while making danger visible. Thresholds are named constants for easy review (500 MiB segment size; 5_000 segments/host). --- ## What is the implementation edit? | File | Role | |------|------| | **NEW** `RealtimeProvisioningWarnings.java` | Warning generator + CLI formatter; canonical docs URL; optional hour/host axes for worst-cell labels | | **NEW** `RealtimeProvisioningWarningsTest.java` | Unit tests for thresholds, NA explanation, cell labels, malformed cells | | `MemoryEstimator.java` | Always populate matrix cells when hours ≤ retention (including over host memory); expose `getMaxUsableHostMemory()` | | `RealtimeProvisioningHelperCommand.java` | Print warnings after grids; reuse docs URL constant in examples | | `RealtimeProvisioningRule.java` | Add `"Warnings"` entry to recommender output as numbered nested map (`"1"` → msg, …) fitting existing `Map<String,Map<String,String>>` payload | | `TestConfigEngine.java` | High-ingestion case asserts non-NA cells + presence of `Warnings` | **Warning categories:** 1. Large estimated segment size (> 500 MiB) — includes worst cell coordinates when axes provided 2. Active memory above max usable host memory 3. Very high segments queried per host (> 5_000) 4. Residual `NA` explanation (hours > retention only) **API note:** #8339 asked for an array of warnings; implementation uses a numbered map under the existing matrix bag for backward-compatible JSON shape. Consumers that iterate recommendation keys as matrices should skip `"Warnings"`. **Behavior change:** Over-memory cells are no longer `NA`. Scripts that treated non-`NA` as “fits in host memory” must read `Warnings` (or compare to max usable memory) going forward. --- ## What is the impact? - **Ops:** See real estimates + explicit warnings instead of silent danger/`NA`. - **Automation:** Possible BC for external scripts that assumed non-`NA` ⇒ safe; documented in this PR. - **Performance:** Negligible (post-estimate scan of small matrices). - **Docs URL:** Uses current site path `operate-pinot/tuning/realtime`. --- ## What is the testing edit? ```text ./mvnw -pl pinot-controller -Dtest=RealtimeProvisioningWarningsTest,TestConfigEngine test # RealtimeProvisioningWarningsTest + TestConfigEngine (incl. high ingestion): PASS ``` Coverage includes: modest grids (no warn), large segment + cell label, memory over host + cell label, high segment count, NA explanation, multiple warnings display format, malformed cell skip, recommender high-ingestion `Warnings` map. Not run: full monorepo precommit, multi-node E2E (tooling-only path). --- ## Checklist - [x] Draft - [x] Backward-compat note for NA semantics - [x] Unit tests added/updated -- 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]
