Tarun-kishore opened a new issue, #19837:
URL: https://github.com/apache/pinot/issues/19837
## Problem
Pinot currently enforces storage and QPS quotas as soon as they are
configured on a table. This makes it risky to introduce or adjust quotas for
existing tables.
- **Storage quota:** Segment uploads are rejected with HTTP 403, and
realtime consumption is paused when the quota is exceeded.
- **QPS quota:** Queries exceeding the configured limit are rejected with
HTTP 429.
There is no way to see how many queries or uploads would have been rejected
by a proposed quota without actually enforcing it. We need a way to evaluate
quota limits before enabling enforcement.
## Proposal
Introduce a `QuotaEnforcementMode` enum with three modes: `ENFORCED`,
`SHADOW`, and `DISABLED`.
Add two optional fields to `QuotaConfig` to control storage and query quota
enforcement independently:
```json
{
"quota": {
"storage": "10G",
"maxQueriesPerSecond": "100",
"storageQuotaEnforcementMode": "SHADOW",
"queryQuotaEnforcementMode": "SHADOW"
}
}
```
| Mode | Behavior |
|---|---|
| **ENFORCED** (default) | Existing behavior. Quota breaches are recorded
and requests are rejected. |
| **SHADOW** | Quota breaches are recorded in metrics and logs, but queries
and uploads are allowed to proceed. |
| **DISABLED** | Quota enforcement is skipped, and no breach metrics are
emitted. |
### Expected Behavior
- **Storage quota:** In `SHADOW` mode, segment uploads should not be
rejected and realtime consumption should not be paused due to quota breaches.
Tables already paused due to storage quota should resume when switched to
`SHADOW`.
- **Query quota:** In `SHADOW` mode, queries exceeding the configured QPS
quota should still be served.
- **Metrics:** `SHADOW` and `ENFORCED` should emit the same quota breach
metrics (`BrokerMeter.QUERY_QUOTA_EXCEEDED` and
`ControllerMeter.STORAGE_QUOTA_EXCEEDED`), allowing operators to evaluate
limits before enforcing them.
- **Backward compatibility:** Tables without the new fields should continue
using `ENFORCED`, preserving existing behavior.
--
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]