-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automatic layer eviction #3552
automatic layer eviction #3552
Conversation
3d620a3
to
fde5965
Compare
NB: the stats reset feature conflicts with this one: if we continuously reset the stats, then the eviction loop has no last access date to base the decision on. Need to figure out what to do here, reset is quite useful in #3540 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is looking good! So the minimum value for unused is the periodic e2e check interval, and ... That's it? What's missing for this to be put very aggressively into staging?
Well, could move all of the eviction stuff into tenant/timeline/eviction.rs
for example.
The last pushes should address all review comments. I'll rebase this PR on top of #3557 once that's merged. |
1a8e4c4
to
8185760
Compare
Addressed this by duplicating the LayerAccessStatsInner.
Good idea, did that. |
Need to figure out how to implement tenant config update via API before we can merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of questions, minor suggestions.
For some reason GitHub doesn't show a comment box for some of your comments, so, I'll reply here:
Well, I don't want to spend time on implementing a CLI-friendly representation of the eviction policy variants here. IMO there should be a Any objections with going forward with JSON? |
This patch adds a per-timeline periodic task that executes an eviction policy. The eviction policy is configurable per tenant. Two policies exist: - NoEviction (the default one) - LayerAccessThreshold The LayerAccessThreshold policy examines the last access timestamp per layer in the layer map and evicts the layer if that last access is further in the past than a configurable threshold value. This policy kind is evaluated periodically at a configurable period. It logs a summary statistic at `info!()` or `warn!()` level, depending on whether any evictions failed. This feature has no explicit killswitch since it's off by default.
f0594a3
to
d14473b
Compare
Force-push: squash & proper commit message (updated top-level PR description as well) |
Try out with
neon_local
by putting the following intopageserver.toml