Skip to content

Commit 6f15692

Browse files
committed
kvs: remove unnecessary kvsroot lookup
Problem: When the kvs module is initially loaded, the primary KVS namespace root is looked up before it is created. There is no point to this lookup, since we are initializing the KVS. This appears to be a cut and paste from other areas of the KVS where a lookup of a kvsroot would make sense before creating it. Solution: Remove this unnecessary kvs root lookup.
1 parent 7766d9b commit 6f15692

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/modules/kvs/kvs.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,23 +2818,15 @@ int mod_main (flux_t *h, int argc, char **argv)
28182818
if (checkpoint_get (h, rootref, sizeof (rootref), &seq) < 0)
28192819
memcpy (rootref, empty_dir_rootref, sizeof (empty_dir_rootref));
28202820

2821-
/* primary namespace must always be there and not marked
2822-
* for removal
2823-
*/
2824-
if (!(root = kvsroot_mgr_lookup_root_safe (ctx->krm,
2825-
KVS_PRIMARY_NAMESPACE))) {
2826-
2827-
if (!(root = kvsroot_mgr_create_root (ctx->krm,
2828-
ctx->cache,
2829-
ctx->hash_name,
2830-
KVS_PRIMARY_NAMESPACE,
2831-
owner,
2832-
0))) {
2833-
flux_log_error (h, "kvsroot_mgr_create_root");
2834-
goto done;
2835-
}
2821+
if (!(root = kvsroot_mgr_create_root (ctx->krm,
2822+
ctx->cache,
2823+
ctx->hash_name,
2824+
KVS_PRIMARY_NAMESPACE,
2825+
owner,
2826+
0))) {
2827+
flux_log_error (h, "kvsroot_mgr_create_root");
2828+
goto done;
28362829
}
2837-
28382830
setroot (ctx, root, rootref, seq);
28392831

28402832
if (event_subscribe (ctx, KVS_PRIMARY_NAMESPACE) < 0) {

0 commit comments

Comments
 (0)