-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: implements the never evict repository policy in the LRU cache given a YAML configuration file #28
Conversation
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.
👏🏼 Nice contribution! This is a really good start but I think we'd want something abit more feature complete before merging in the config file stuff.
See a few of my comments below.
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.
Looking good so far!
This will be feature complete once the bits are in place in the tryEvict
function within the cache. You'll want to pass in the data structure of repos to not evict down into the LRU cache.
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.
Just a small error flow change I noticed. Happy to tackle that in a subsequent change.
@k1nho - are you interested in tackling the integration of the "never evict" map into the LRU cache itself? We shouldn't merge code that is half-baked (pun intended) and I'd like to avoid the main branch having commits that are not feature complete. Although, this isn't introducing breaking changes, it would just be confusing for anyone looking at the main branch commits. |
@jpmcb sure, I can give it a try! I was waiting based on the scope of the issue, but if it is ok to do it in this one I can try. I would like to know more about certain cases, right now I think of two in particular, would like to get more info on this.
|
I think both those cases are misconfigurations: ideally someone shouldn't configure the cache to be smaller than their list of "never evict" repos nor should they have We should provide feedback that something's not right. Let's start with a warning message and go from there. |
Ok, trying to understand better the implementation. This case, for example, where we have repo3 on the LRU spot, but since repo3 is on |
Right.
Correct.
That's correct. Typically that would be a cache "drop". But again, I would say that's a misconfiguration on the part of the user deploying this service. There should always be some amount of disk space free and the size of the repos in In that scenario, we should log out a warning message that can be surfaced by administrators. And in the future, we may add some metrics that denote cache "drops" so they can see a problem has started with the service. But for now, start with something basic. Something like a check in the eviction algorithm that sees if the node up for eviction is in the hashmap. If it is, skip and go to the next node in the list. |
Awesome, I understand better now! I did the implementation, but need some help with the test setup. Right now, we have a test The way I have it now is that when |
f7ea79f
to
f076008
Compare
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.
Preliminary review: I think you're on the right track! Thanks for sticking with this one. It's a huge feature. Hoping to give this a more in depth review this week.
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.
This is getting very close! Almost there!!
Add flag to acquire filepath, and consume yaml for server configuration Drill config to LRU cache Remove else branch, early return on bad config Change providers to take the NeverEvictRepo type instead of Config change error flow structure make errors descriptive and use Faltalf implementing never evict repos into the LRU remove test for now change int for bool type and clarify lru to lruNode add neverEvictRepos as a data member to GitRepoLRUCache to maintain Put API free of the neverEvictRepos argument go mod tidy separate group imports
93adada
to
8c22e1f
Compare
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.
Great work!! Very well done!!!! 👏🏼👏🏼
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.
🍕
Description
This PR adds a flag config that will parse a string path during server startup. It defaults to an empty string, if no config flag is provided
What type of PR is this? (check all applicable)
Related Tickets & Documents
#26 Flag to consume yaml file at path to prevent eviction from cache of configured repos
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?