-
Notifications
You must be signed in to change notification settings - Fork 50
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
kvs: refactor with internal kvsroot file #1321
Conversation
commit_mgr_iter_not_ready_fences() should clean up the remove list on a callback error.
Looks like a good direction. I restarted a travis build that had stalled for no apparent reason. |
Codecov Report
@@ Coverage Diff @@
## master #1321 +/- ##
========================================
Coverage ? 78.2%
========================================
Files ? 156
Lines ? 28269
Branches ? 0
========================================
Hits ? 22107
Misses ? 6162
Partials ? 0
|
ok, let me add documentation & unit tests, then this should be all good to go. |
Move destroy_root(), remove_root(), create_root(), lookup_root(), and lookup_root_safe() over to new files. Adjust code appropriately given move.
Prefix kvsroot to kvsroot internal API functions, adjusting functions names appropriately and updating callers.
Adjust core kvs callers that iterate manually through the roothash.
Adjust/change function names for abstraction creation.
Variables previously passed to kvsroot_mgr_create_root(), now handled by the manager itself in kvsroot_mgr_create().
Allow removal of entries from kvsroot roothash while iterating by abstracting away remove logic from the user.
aa57717
to
0f9ec32
Compare
added a few header comments in |
Looks good @chu11 - no coverage report here (?) but it was +0.003% in the last report and it seems it can't help but have gone up from there with the new tests, so I'm good to merge if you're ready. |
yup, all done. |
This branch isn't ready for merging (need to add documentation & unit tests) but thought I'd push to ask for comments.
I had originally gone down the path of abstracting the kvsroot way more than what is done in this PR. But as I was refactoring, it became clear abstracting
struct kvsroot
was creating a complex and probably unnecessary level of abstraction.For example, abstracting
start_root_remove()
inkvs.c
. It's a good idea to want to abstract it away, but its difficult to abstract away the cleanup of fences sitting in the commit manager. Do we ask the user to pass in a callback function to deal with the cleanup of fences? We aren't abstracting very well if we're asking the user for that.I briefly considered moving everything related to commits into
kvsroot.c
, but seemed like too much. So I think other refactoring needs to be done before moving onto refactoring kvsroot more. Some thoughts for the future.fence.[ch]
. Perhaps everything should be collapsed into the commit manager in some way.