Skip to content

ref(allocation-policies): Share sliding-window bookkeeping between the bytes policies - #8640

Closed
dezzeddi wants to merge 1 commit into
masterfrom
dani/bytes-policies-shared-window
Closed

dezzeddi wants to merge 1 commit into
masterfrom
dani/bytes-policies-shared-window

Conversation

@dezzeddi

Copy link
Copy Markdown
Member

BytesScannedRejectingPolicy (BSR) and BytesScannedWindowAllocationPolicy (BSW) each build the same Redis sliding-window calls: a check that asks how much of the window is left, and a record of the bytes a query used.

This moves that bookkeeping into BaseBytesScannedPolicy (_granted_bytes, _record_bytes), with the shared 10-minute window constants and rate limiter. Both policies now extend it.

Zero behaviour change: every window key, request size, limit, config name and decision stays the same. Each policy still decides which window a query counts against and what to do over the limit.

…e bytes policies

BytesScannedRejectingPolicy and BytesScannedWindowAllocationPolicy each built
the same Redis sliding-window check and record calls. Move them, with the
window constants and the rate limiter, into a BaseBytesScannedPolicy. Window
keys, request sizes, limits and decisions are unchanged.
@dezzeddi

Copy link
Copy Markdown
Member Author

Combined into #8642.

@dezzeddi dezzeddi closed this Oct 29, 2026
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.

1 participant