fix(object_store): prioritize client-ordered buckets and correct decay#76
Merged
fix(object_store): prioritize client-ordered buckets and correct decay#76
Conversation
Greptile SummaryThis PR fixes the bucket scoring algorithm to better prioritize client-ordered buckets and healthy buckets over failing ones. The key changes are:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[observe bucket, outcome] --> B{outcome?}
B -->|Success| C[Reset consecutive_failures]
B -->|Failure| D[Increment consecutive_failures]
B --> E[Apply time-based decay to error_rate]
E --> F{outcome?}
F -->|Success| G[Update latency histogram]
F -->|Failure| H[error_rate += ALPHA]
H --> I[Clamp error_rate to max 1.0]
I --> J[Update last_failure_time]
G --> K[Update last_update]
J --> K
C --> G
D --> H
L[score bucket] --> M[Calculate base = idx * 2000]
M --> N{bucket known?}
N -->|No| O[Return base + 5000]
N -->|Yes| P[Get latency snapshot]
P --> Q[Calculate lat = mean_micros / 100]
Q --> R{circuit_open?}
R -->|Yes| S[err = 1_000_000]
R -->|No| T[err = error_rate * 100_000]
S --> U[Return base + err + lat]
T --> U
V[attempt_order] --> W[Sort by score, then index]
W --> X[Preserve client order on ties]
Last reviewed commit: 500ecc6 |
Merged
shikhar
pushed a commit
that referenced
this pull request
Feb 19, 2026
## 🤖 New release * `cachey`: 0.10.0 -> 0.10.1 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.10.1](0.10.0...0.10.1) - 2026-02-19 ### Fixed - *(throughput)* use fractional lookback divisor ([#78](#78)) - *(object_store)* prioritize client-ordered buckets and correct decay ([#76](#76)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
Closes #43
Closes #68