-
Notifications
You must be signed in to change notification settings - Fork 535
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
Implement cache policy contract for ODSP driver #2282
Conversation
With the functionality we have today, I'd rather see it implemented via one of these two ways:
|
That said, the shape you propose may make sense if we keep adding stuff to policy interface, hard to say given unknowns |
@vladsud - The issue I have is that our cache has no idea of the context of what the driver is trying to save. For example, join session is not safe to save for many weeks, trees/latest might be, blobs definitely are. |
I'm fine putting it on the cache interface (though that's kind of weird) or having the driver pass more context on what is being asked to be stored. |
I don't think # 1 is feasible, unless we update the cache API to give the cache implementer more context. I am open to # 2, even though that contract is a bit awkward to have the cache implementation and policy on the same interface |
I think we will want to provide more context either way (like if you need to evict all data for given file, or prioritize some files over others.). How about I add that and we see where it leads us? |
@markfields - FYI, can we get your PR in today to avoid conflicts in this area before I start poking here? |
So which would you prefer?
I think the first one is more flexible and provides more options. |
Sure, I am open to other approaches. The first issue we need to solve is the 10 second default right now. That should be our priority, giving host apps a way to specify they should cache longer. I do want to keep the cache implementation simple, if we can. |
Closing since Vlad has offered to go about this in a better way. |
As we start looking into improving performance for boot scenarios via snapshot caching, it's become clear that the host app is going to need to provide input on how the cache is used, since each host may have different scenarios or preferences.
Principles: