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: add namespace parameter to most kvs api functions #1977
Conversation
repushed, python formatting error |
hmmmm error in t2000-wreck hit.
concerning b/c I have course modified code in area of kvs.watch. Possible a bug in connector.local? Mentioned in #1641, #1386 (which points to #542). |
hmmm. While I have modified code in |
I wonder if Not saying that's what's happening, but maybe worth giving the KVS functions used by |
If the flux_t handle were closed, hopefully wrexecd isn't doing any kvs calls? :-) The removal of |
Actually, I forgot to point this out originally. The removal of
the kvs-classic get cannot be passed |
I was suggesting a kvs call fails in a new way, then handle is closed, then a use after free, such as a |
Skimming through, I see what you mean - not a lot to worry about! One minor thing |
Is the fact that (in the kvs module) |
Now that you mention it, I agree, it's not a useful "convenience" function to make public anymore. I'll yoink it. |
Hmmm. if (wait_destroy_msg (root->watchlist, unwatch_cmp, &p) < 0) {
errnum = errno;
flux_log_error (h, "%s: wait_destroy_msg", __FUNCTION__);
goto done;
}
if (cache_wait_destroy_msg (ctx->cache, unwatch_cmp, &p) < 0) {
errnum = errno;
flux_log_error (h, "%s: cache_wait_destroy_msg", __FUNCTION__);
goto done;
} The call to BUT the cache is shared between lookups, commits, watches, etc. and not every operation requires a namespace to be specified, most notably This is probably for another issue. Or do we just punt until we remove the old watch interface? |
Actually, the call to |
yeah, I think the |
Values being required to be JSON formatted was removed during tree object conversion in the KVS.
Add a namespace parameter to flux_kvs_commit() and flux_kvs_fence(). If the ns argument is NULL, follow prior rules on selecting a default namespace. As a side effect remove flux_kvs_commit_ns(). Update all docs, callers, and tests appropriately.
Add namespace parameter to flux_kvs_get_version() and flux_kvs_wait_version(). Update callers appropriately.
Add a namespace parameter to flux_kvs_watch family of functions. Update callers appropriately.
Add a namespace parameter to flux_kvs_lookup(). If the ns argument is NULL, follow prior rules on selecting a default namespace. As a side effect remove flux_kvs_lookup_ns(). Update all docs, callers, and tests appropriately.
With flux kvs functions now taking namespaces, remove use of flux_kvs_set_namespace() in several tests.
Support a -N ns option for any kvs commands that support namespaces. This is in preperation for the removal of the global -N option.
Use the --namespace option assigned to individual flux-kvs sub-commands and not the global --namespace option.
Remove calls to it and remove documentation as well.
Remove global --namespace option and document --namespace option in the sub-commands that it is supported in.
As namespaces can only be set via environment variable now, the need for a public function like flux_kvs_get_namespace() is no longer necessary. Create a private convenience function kvs_get_namespace() for internal use.
re-pushed, removing |
Thanks! |
Add a namespace parameter to most kvs functions, such as
flux_kvs_lookup()
,flux_kvs_fence()
,flux_kvs_commit()
,flux_kvs_get_version()
,flux_kvs_wait_version()
, and a variety offlux_kvs_watch
functions. Long ago, this was avoided to not break ABI. But recent changes, including the use of namespaces influx_kvs_copy/move()
showed the necessity of finally biting the bullet on this.As a side effect of this, remove
flux_kvs_set_namespace()
, which is no longer needed as namespaces can be passed directly to all these functions. Now callers pass in a namespace to a function, or set it via an environment variable, or they get the default of primary. There is no namespace attached to a flux handle anymore.As a side effect of removing
flux_kvs_set_namespace()
, the--namespace
option influx-kvs
no longer works. We instead make the--namespace
option influx-kvs
an option for all subcommands that can use it. In my opinion, this is much better. The--namespace
option only applies to those subcommands that can use it (i.e. specify--namespace
for get/put, but there is no option for dropcache). In addition, I think the flow of the command makes a lot more sense. Instead of:flux kvs --namespace=FOO get a.key
it's now
flux kvs get --namespace=FOO get a.key
The namespace option should be specified to the "right" of the subcommand.
Also fixed a few dinky things along the way.
I will be sending a PR to update flux-sched as well on this.