-
Notifications
You must be signed in to change notification settings - Fork 51
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: general refactoring and cleanup #1314
Conversation
Callers never pass a non-NULL initial rootdir, so remove code surrounding this option.
Check if a namespace remove is already in progress before removing a namespace root.
Move start_root_remove() and root_remove_process_fences() closer to the functions that use them.
Refactor commit_mgr_process_fence_request() to take a fence name instead of a fence pointer. API should not assume user passed in a fence that has already been added to the commit manager via commit_mgr_add_fence().
Using new fence aux int, set flag indicating if a fence has already been placed on the ready list. If it has already been placed on the ready list, don't add it to the ready list again.
Rename to commit_mgr_iter_not_ready_fences(). We want to abstract what "ready" vs "not-ready" fence means in this API and not rely on the user to know. Adjust core code in main KVS file appropriately. Also add some extra comments on usage.
Remove struct finalize_data, is unnecessary, just use struct kvs_cb_data.
Internally manage/allow commit_mgr_remove_fence() to be called if you are iterating through fences via commit_mgr_iter_not_ready_fences(). This abstracts commit mgr more from the user, not requiring the user to understand internals of how the commit mgr is implemented.
Check that we are not currently iterating through fences, we do not want to modify the hash while iterating.
Check that the fence only has one name and has not yet been merged with another fence.
There is no need to complete the setroot if the namespace is in process of being removed.
Recent changes to the core KVS file lead to a change in how many of the functions in the file were called and/or used. Those functions now seem "out of place" given the current code. Move functions around and re-organize in general. No code has changed in this commit. Functions have only been moved around.
Changes Unknown when pulling 44dc055 on chu11:kvscleanup9 into ** on flux-framework:master**. |
hit #1150, restarting a builder |
Codecov Report
@@ Coverage Diff @@
## master #1314 +/- ##
==========================================
+ Coverage 78.23% 78.29% +0.05%
==========================================
Files 154 154
Lines 28100 28133 +33
==========================================
+ Hits 21984 22026 +42
+ Misses 6116 6107 -9
|
code coverage diff is not too good. I re-organized so much code that effectively many of the uncoverable error paths that were not-covered before are not-covered again. The diff coverage did make me notice one other thing that could be cleaned up. The |
Refactor out "now" parameter, as it is only set to false.
Changes Unknown when pulling 24e13de on chu11:kvscleanup9 into ** on flux-framework:master**. |
If there's just the one "ready" flag, maybe a mask of flags should be replaced with |
LGTM otherwise. |
Do you mean a |
OK, well not a big deal to be sure. LMK when you're done poking at it and I'll have one more spin through before merging. |
I think I'm done with this PR. |
OK, great! Thanks. |
This PR has a few tiny corner case fixes, some general refactoring/abstraction fixes in the internal commit API, and some code re-organization in the core KVS file.