diff --git a/doc/Makefile.am b/doc/Makefile.am index 76884f7c73f6..8139b4b6a7ee 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -283,7 +283,6 @@ MAN3_FILES_SECONDARY = \ man3/flux_kvs_getroot_get_sequence.3 \ man3/flux_kvs_getroot_get_owner.3 \ man3/flux_kvs_getroot_cancel.3 \ - man3/flux_kvs_fence.3 \ man3/flux_kvs_commit_get_treeobj.3 \ man3/flux_kvs_commit_get_rootref.3 \ man3/flux_kvs_commit_get_sequence.3 \ diff --git a/doc/man1/flux-shell.rst b/doc/man1/flux-shell.rst index 172f6661985b..1b9fae9ddbdc 100644 --- a/doc/man1/flux-shell.rst +++ b/doc/man1/flux-shell.rst @@ -407,11 +407,6 @@ plugins include: Skip pre-populating the ``flux.taskmap`` and ``PMI_process_mapping`` keys in the ``simple`` implementation. -.. option:: pmi-simple.kvs=native - - Use the native Flux KVS instead of the PMI plugin's built-in key exchange - algorithm in the ``simple`` implementation. - .. option:: pmi-simple.exchange.k=N Configure the PMI plugin's built-in key exchange algorithm to use a diff --git a/doc/man3/flux_kvs_commit.rst b/doc/man3/flux_kvs_commit.rst index e51ddb25eeba..6f063acdcee1 100644 --- a/doc/man3/flux_kvs_commit.rst +++ b/doc/man3/flux_kvs_commit.rst @@ -16,13 +16,6 @@ SYNOPSIS int flags, flux_kvs_txn_t *txn); - flux_future_t *flux_kvs_fence (flux_t *h, - const char *ns, - int flags, - const char *name, - int nprocs, - flux_kvs_txn_t *txn); - int flux_kvs_commit_get_treeobj (flux_future_t *f, const char **treeobj); @@ -47,31 +40,21 @@ namespace, or if set, the namespace from the FLUX_KVS_NAMESPACE environment variable. Note that all transactions operate on the same namespace. -:func:`flux_kvs_fence` is a "collective" version of :func:`flux_kvs_commit` -that supports multiple callers. Each caller uses the same :var:`flags`, -:var:`name`, and :var:`nprocs` arguments. Once :var:`nprocs` requests are -received by the KVS service for the named operation, the transactions are -combined and committed together as one transaction. :var:`name` must be unique -across the Flux session and should not be reused, even after the fence is -complete. - :man3:`flux_future_then` may be used to register a reactor callback -(continuation) to be called once the response to the commit/fence +(continuation) to be called once the response to the commit request has been received. :man3:`flux_future_wait_for` may be used to block until the response has been received. Both accept an optional timeout. :man3:`flux_future_get`, :func:`flux_kvs_commit_get_treeobj`, :func:`flux_kvs_commit_get_rootref`, or :func:`flux_kvs_commit_get_sequence` -can decode the response. A return of 0 indicates success and the -entire transaction was committed. A return of -1 indicates failure, -none of the transaction was committed. All can be used on the -:type:`flux_future_t` returned by :func:`flux_kvs_commit` or -:func:`flux_kvs_fence`. +can decode the response. A return of 0 indicates success and the entire +transaction was committed. A return of -1 indicates failure, none of the +transaction was committed. In addition to checking for success or failure, :func:`flux_kvs_commit_get_treeobj`, :func:`flux_kvs_commit_get_rootref()`, and :func:`flux_kvs_commit_get_sequence` can return information about the -root snapshot that the commit or fence has completed its transaction on. +root snapshot that the commit has completed its transaction on. :func:`flux_kvs_commit_get_treeobj` obtains the root hash in the form of an RFC 11 *dirref* treeobj, suitable to be passed to @@ -87,7 +70,7 @@ FLAGS ===== The following are valid bits in a :var:`flags` mask passed as an argument -to :func:`flux_kvs_commit` or :func:`flux_kvs_fence`. +to :func:`flux_kvs_commit`. FLUX_KVS_NO_MERGE The KVS service may merge contemporaneous commit transactions as an @@ -99,9 +82,8 @@ FLUX_KVS_NO_MERGE RETURN VALUE ============ -:func:`flux_kvs_commit` and :func:`flux_kvs_fence` return a -:type:`flux_future_t` on success, or NULL on failure with :var:`errno` set -appropriately. +:func:`flux_kvs_commit` returns a :type:`flux_future_t` on success, or NULL +on failure with :var:`errno` set appropriately. ERRORS @@ -122,10 +104,6 @@ ENOSYS ENOTSUP An unknown namespace was requested. -EOVERFLOW - :func:`flux_kvs_fence` has been called too many times and :var:`nprocs` has - been exceeded. - RESOURCES ========= diff --git a/doc/man3/flux_kvs_txn_create.rst b/doc/man3/flux_kvs_txn_create.rst index b83f08dc5a79..9174b8acf4c4 100644 --- a/doc/man3/flux_kvs_txn_create.rst +++ b/doc/man3/flux_kvs_txn_create.rst @@ -66,10 +66,10 @@ The Flux Key Value Store is a general purpose distributed storage service used by Flux services. :func:`flux_kvs_txn_create` creates a KVS transaction object that may be -passed to :man3:`flux_kvs_commit` or :man3:`flux_kvs_fence`. The transaction -consists of a list of operations that are applied to the KVS together, -in order. The entire transaction either succeeds or fails. After commit -or fence, the object must be destroyed with :func:`flux_kvs_txn_destroy`. +passed to :man3:`flux_kvs_commit`. The transaction consists of a list +of operations that are applied to the KVS together, in order. The +entire transaction either succeeds or fails. After commit, the object +must be destroyed with :func:`flux_kvs_txn_destroy`. Each function below adds a single operation to :var:`txn`. :var:`key` is a hierarchical path name with period (".") used as path separator. diff --git a/doc/manpages.py b/doc/manpages.py index 43cf27d0388f..40832827a285 100644 --- a/doc/manpages.py +++ b/doc/manpages.py @@ -127,7 +127,6 @@ ('man3/flux_idle_watcher_create', 'flux_prepare_watcher_create', 'create prepare/check/idle watchers', [author], 3), ('man3/flux_idle_watcher_create', 'flux_check_watcher_create', 'create prepare/check/idle watchers', [author], 3), ('man3/flux_idle_watcher_create', 'flux_idle_watcher_create', 'create prepare/check/idle watchers', [author], 3), - ('man3/flux_kvs_commit', 'flux_kvs_fence', 'commit a KVS transaction', [author], 3), ('man3/flux_kvs_commit', 'flux_kvs_commit_get_treeobj', 'commit a KVS transaction', [author], 3), ('man3/flux_kvs_commit', 'flux_kvs_commit_get_rootref', 'commit a KVS transaction', [author], 3), ('man3/flux_kvs_commit', 'flux_kvs_commit_get_sequence', 'commit a KVS transaction', [author], 3), diff --git a/src/common/libkvs/kvs_commit.c b/src/common/libkvs/kvs_commit.c index fb2e1a11d6e5..cd3aad37c82f 100644 --- a/src/common/libkvs/kvs_commit.c +++ b/src/common/libkvs/kvs_commit.c @@ -35,73 +35,6 @@ static void free_ctx (struct commit_ctx *ctx) } } -static struct commit_ctx *alloc_ctx (void) -{ - struct commit_ctx *ctx; - if (!(ctx = calloc (1, sizeof (*ctx)))) - return NULL; - return ctx; -} - -flux_future_t *flux_kvs_fence (flux_t *h, - const char *ns, - int flags, - const char *name, - int nprocs, - flux_kvs_txn_t *txn) -{ - flux_future_t *f; - struct commit_ctx *ctx = NULL; - json_t *ops; - - if (!name || nprocs <= 0 || !txn) { - errno = EINVAL; - return NULL; - } - - if (!ns) { - if (!(ns = kvs_get_namespace ())) - return NULL; - } - - if (flags & FLUX_KVS_TXN_COMPACT) { - if (txn_compact (txn) < 0) - return NULL; - flags &= ~FLUX_KVS_TXN_COMPACT; - } - - if (!(ops = txn_get_ops (txn))) { - errno = EINVAL; - return NULL; - } - - if (!(ctx = alloc_ctx ())) - return NULL; - - if (!(f = flux_rpc_pack (h, - "kvs.fence", - FLUX_NODEID_ANY, - 0, - "{s:s s:i s:s s:i s:O}", - "name", name, - "nprocs", nprocs, - "namespace", ns, - "flags", flags, - "ops", ops))) - goto error; - - if (flux_future_aux_set (f, auxkey, ctx, (flux_free_f)free_ctx) < 0) - goto error_future; - - return f; - -error_future: - flux_future_destroy (f); -error: - free_ctx (ctx); - return NULL; -} - flux_future_t *flux_kvs_commit (flux_t *h, const char *ns, int flags, @@ -132,7 +65,7 @@ flux_future_t *flux_kvs_commit (flux_t *h, return NULL; } - if (!(ctx = alloc_ctx ())) + if (!(ctx = calloc (1, sizeof (*ctx)))) return NULL; if (!(f = flux_rpc_pack (h, diff --git a/src/common/libkvs/kvs_commit.h b/src/common/libkvs/kvs_commit.h index 137c0d82a37a..288b35eab62a 100644 --- a/src/common/libkvs/kvs_commit.h +++ b/src/common/libkvs/kvs_commit.h @@ -48,14 +48,7 @@ flux_future_t *flux_kvs_commit (flux_t *h, int flags, flux_kvs_txn_t *txn); -flux_future_t *flux_kvs_fence (flux_t *h, - const char *ns, - int flags, - const char *name, - int nprocs, - flux_kvs_txn_t *txn); - -/* accessors can be used for commit or fence futures */ +/* accessors can be used for commit futures */ int flux_kvs_commit_get_treeobj (flux_future_t *f, const char **treeobj); int flux_kvs_commit_get_rootref (flux_future_t *f, const char **rootref); int flux_kvs_commit_get_sequence (flux_future_t *f, int *rootseq); diff --git a/src/common/libkvs/test/kvs_commit.c b/src/common/libkvs/test/kvs_commit.c index 66808601d2b7..264f2b7f5003 100644 --- a/src/common/libkvs/test/kvs_commit.c +++ b/src/common/libkvs/test/kvs_commit.c @@ -24,16 +24,6 @@ void errors (void) /* check simple error cases */ - errno = 0; - ok (flux_kvs_fence (NULL, NULL, 0, NULL, 0, NULL) == NULL - && errno == EINVAL, - "flux_kvs_fence fails on bad params"); - - errno = 0; - ok (flux_kvs_fence (NULL, NULL, 0, "foo", 1, NULL) == NULL - && errno == EINVAL, - "flux_kvs_fence fails on bad handle"); - errno = 0; ok (flux_kvs_commit (NULL, NULL, 0, NULL) == NULL && errno == EINVAL, diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index fdf27d4ce1b2..1c55f0741679 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -79,7 +79,6 @@ struct kvs_ctx { unsigned int seq; /* for commit transactions */ kvs_checkpoint_t *kcp; tstat_t txn_commit_stats; - tstat_t txn_fence_stats; zhashx_t *requests; /* track unfinished requests */ struct list_head work_queue; }; @@ -966,7 +965,7 @@ static void kvstxn_apply_cb (flux_future_t *f, void *arg) kvstxn_apply (kt); } -/* Write all the ops for a particular commit/fence request (rank 0 +/* Write all the ops for a particular commit request (rank 0 * only). The setroot event will cause responses to be sent to the * transaction requests and clean up the treq_t state. This * function is idempotent. @@ -1848,243 +1847,6 @@ static void commit_request_cb (flux_t *h, request_tracking_remove (ctx, msg); } - -/* kvs.relayfence (rank 0 only, no response). - */ -static void relayfence_request_cb (flux_t *h, - flux_msg_handler_t *mh, - const flux_msg_t *msg, - void *arg) -{ - struct kvs_ctx *ctx = arg; - struct kvsroot *root; - const char *ns; - const char *name; - int saved_errno, nprocs, flags; - json_t *ops = NULL; - treq_t *tr; - - if (flux_request_unpack (msg, - NULL, - "{ s:o s:s s:s s:i s:i }", - "ops", &ops, - "name", &name, - "namespace", &ns, - "flags", &flags, - "nprocs", &nprocs) < 0) { - flux_log_error (h, "%s: flux_request_unpack", __FUNCTION__); - return; - } - - /* namespace must exist given we are on rank 0 */ - if (!(root = kvsroot_mgr_lookup_root_safe (ctx->krm, ns))) { - errno = ENOTSUP; - goto error; - } - - if (!(tr = treq_mgr_lookup_transaction (root->trm, name))) { - if (!(tr = treq_create (name, nprocs, flags))) { - flux_log_error (h, "%s: treq_create", __FUNCTION__); - goto error; - } - if (treq_mgr_add_transaction (root->trm, tr) < 0) { - saved_errno = errno; - flux_log_error (h, "%s: treq_mgr_add_transaction", __FUNCTION__); - treq_destroy (tr); - errno = saved_errno; - goto error; - } - } - - if (treq_get_flags (tr) != flags - || treq_get_nprocs (tr) != nprocs) { - errno = EINVAL; - goto error; - } - - if (treq_add_request_ops (tr, ops) < 0) { - flux_log_error (h, "%s: treq_add_request_ops", __FUNCTION__); - goto error; - } - - if (treq_count_reached (tr)) { - - /* If user called fence > nprocs time, should have been caught - * earlier */ - assert (!treq_get_processed (tr)); - - /* we use this flag to indicate if a treq has been added to - * the ready queue */ - treq_mark_processed (tr); - - if (kvstxn_mgr_add_transaction (root->ktm, - treq_get_name (tr), - treq_get_ops (tr), - treq_get_flags (tr), - 0) < 0) { - flux_log_error (h, "%s: kvstxn_mgr_add_transaction", __FUNCTION__); - goto error; - } - - tstat_push (&ctx->txn_fence_stats, - (double)json_array_size (treq_get_ops (tr))); - - work_queue_check_append (ctx, root); - } - - /* N.B. no request tracking for relay. The relay does not get a - * response, only the original via finalize_transaction_bynames(). - */ - return; - -error: - /* An error has occurred, so we will return an error similarly to - * how an error would be returned via a transaction error in - * kvstxn_apply(). - */ - if (error_event_send_to_name (ctx, ns, name, errno) < 0) - flux_log_error (h, "%s: error_event_send_to_name", __FUNCTION__); -} - -/* kvs.fence - * Sent from users to local kvs module. - */ -static void fence_request_cb (flux_t *h, - flux_msg_handler_t *mh, - const flux_msg_t *msg, - void *arg) -{ - struct kvs_ctx *ctx = arg; - struct kvsroot *root; - const char *ns; - const char *name; - int saved_errno, nprocs, flags; - bool stall = false; - json_t *ops = NULL; - treq_t *tr; - flux_error_t error; - const char *errmsg = NULL; - - if (flux_request_unpack (msg, - NULL, - "{ s:o s:s s:s s:i s:i }", - "ops", &ops, - "name", &name, - "namespace", &ns, - "flags", &flags, - "nprocs", &nprocs) < 0) { - flux_log_error (h, "%s: flux_request_unpack", __FUNCTION__); - goto error; - } - if (flux_msg_authorize (msg, FLUX_USERID_UNKNOWN) < 0 - && guest_commit_authorize (ops, &error) < 0) { - errno = EPERM; - errmsg = error.text; - goto error; - } - - if (!(root = getroot (ctx, ns, mh, msg, NULL, &stall))) { - if (stall) { - request_tracking_add (ctx, msg); - goto stall; - } - goto error; - } - - if (!(tr = treq_mgr_lookup_transaction (root->trm, name))) { - if (!(tr = treq_create (name, nprocs, flags))) { - flux_log_error (h, "%s: treq_create", __FUNCTION__); - goto error; - } - if (treq_mgr_add_transaction (root->trm, tr) < 0) { - saved_errno = errno; - flux_log_error (h, "%s: treq_mgr_add_transaction", __FUNCTION__); - treq_destroy (tr); - errno = saved_errno; - goto error; - } - } - - if (treq_get_flags (tr) != flags - || treq_get_nprocs (tr) != nprocs) { - errno = EINVAL; - goto error; - } - - /* save copy of request, will be used later via - * finalize_transaction_bynames() to send error code to original - * send. - */ - if (treq_add_request_copy (tr, msg) < 0) - goto error; - - /* If we happen to be on rank 0, perform equivalent of - * relayfence_request_cb() here instead of sending an RPC - */ - if (ctx->rank == 0) { - - if (treq_add_request_ops (tr, ops) < 0) { - flux_log_error (h, "%s: treq_add_request_ops", __FUNCTION__); - goto error; - } - - if (treq_count_reached (tr)) { - - /* If user called fence > nprocs time, should have been caught - * earlier */ - assert (!treq_get_processed (tr)); - - /* we use this flag to indicate if a treq has been added to - * the ready queue */ - treq_mark_processed (tr); - - if (kvstxn_mgr_add_transaction (root->ktm, - treq_get_name (tr), - treq_get_ops (tr), - treq_get_flags (tr), - 0) < 0) { - flux_log_error (h, - "%s: kvstxn_mgr_add_transaction", - __FUNCTION__); - goto error; - } - - tstat_push (&ctx->txn_fence_stats, - (double)json_array_size (treq_get_ops (tr))); - - work_queue_check_append (ctx, root); - } - } - else { - flux_future_t *f; - - /* route to rank 0 as instance owner */ - if (!(f = flux_rpc_pack (h, - "kvs.relayfence", - 0, - FLUX_RPC_NORESPONSE, - "{ s:O s:s s:s s:i s:i }", - "ops", ops, - "name", name, - "namespace", ns, - "flags", flags, - "nprocs", nprocs))) { - flux_log_error (h, "%s: flux_rpc_pack", __FUNCTION__); - goto error; - } - flux_future_destroy (f); - } - request_tracking_add (ctx, msg); - return; - -error: - if (flux_respond_error (h, msg, errno, errmsg) < 0) - flux_log_error (h, "%s: flux_respond_error", __FUNCTION__); - request_tracking_remove (ctx, msg); -stall: - return; -} - static void wait_version_request_cb (flux_t *h, flux_msg_handler_t *mh, const flux_msg_t *msg, @@ -2283,7 +2045,7 @@ static void setroot_event_cb (flux_t *h, /* if root not initialized, nothing to do * - small chance we could receive setroot event on namespace that * is being removed. Would require events to be received out of - * order (commit/fence completes before namespace removed, but + * order (commit completes before namespace removed, but * namespace remove event received before setroot). */ if (!(root = kvsroot_mgr_lookup_root (ctx->krm, ns))) @@ -2385,7 +2147,6 @@ static void stats_get_cb (flux_t *h, json_t *tstats = NULL; json_t *cstats = NULL; json_t *txncstats = NULL; - json_t *txnfstats = NULL; json_t *nsstats = NULL; tstat_t ts = { 0 }; int size = 0, incomplete = 0, dirty = 0; @@ -2414,9 +2175,6 @@ static void stats_get_cb (flux_t *h, if (!(txncstats = get_tstat_obj (&ctx->txn_commit_stats, 1.0))) goto nomem; - if (!(txnfstats = get_tstat_obj (&ctx->txn_fence_stats, 1.0))) - goto nomem; - if (!(nsstats = json_object ())) goto nomem; @@ -2445,18 +2203,16 @@ static void stats_get_cb (flux_t *h, if (flux_respond_pack (h, msg, - "{ s:O s:O s:{s:O s:O} s:i }", + "{ s:O s:O s:{s:O} s:i }", "cache", cstats, "namespace", nsstats, "transaction-opcount", "commit", txncstats, - "fence", txnfstats, "pending_requests", zhashx_size (ctx->requests)) < 0) flux_log_error (h, "%s: flux_respond_pack", __FUNCTION__); json_decref (tstats); json_decref (cstats); json_decref (txncstats); - json_decref (txnfstats); json_decref (nsstats); return; nomem: @@ -2467,7 +2223,6 @@ static void stats_get_cb (flux_t *h, json_decref (tstats); json_decref (cstats); json_decref (txncstats); - json_decref (txnfstats); json_decref (nsstats); } @@ -2481,7 +2236,6 @@ static void stats_clear (struct kvs_ctx *ctx) { ctx->faults = 0; memset (&ctx->txn_commit_stats, '\0', sizeof (ctx->txn_commit_stats)); - memset (&ctx->txn_fence_stats, '\0', sizeof (ctx->txn_fence_stats)); if (kvsroot_mgr_iter_roots (ctx->krm, stats_clear_root_cb, NULL) < 0) flux_log_error (ctx->h, "%s: kvsroot_mgr_iter_roots", __FUNCTION__); @@ -3045,18 +2799,6 @@ static const struct flux_msg_handler_spec htab[] = { relaycommit_request_cb, 0 }, - { - FLUX_MSGTYPE_REQUEST, - "kvs.fence", - fence_request_cb, - FLUX_ROLE_USER - }, - { - FLUX_MSGTYPE_REQUEST, - "kvs.relayfence", - relayfence_request_cb, - 0 - }, { FLUX_MSGTYPE_REQUEST, "kvs.namespace-create", diff --git a/src/modules/kvs/kvstxn.h b/src/modules/kvs/kvstxn.h index 1e715cf35b12..9f074de88b3f 100644 --- a/src/modules/kvs/kvstxn.h +++ b/src/modules/kvs/kvstxn.h @@ -162,8 +162,7 @@ void kvstxn_mgr_destroy (kvstxn_mgr_t *ktm); /* kvstxn_mgr_add_transaction() will internally create a kvstxn_t and * store it in the queue of ready to process transactions. * - * This should be called once per transaction (commit or fence) - * request. + * This should be called once per transaction request. */ int kvstxn_mgr_add_transaction (kvstxn_mgr_t *ktm, const char *name, diff --git a/src/shell/pmi/pmi.c b/src/shell/pmi/pmi.c index 044746ecd48f..7aac6eb32d9a 100644 --- a/src/shell/pmi/pmi.c +++ b/src/shell/pmi/pmi.c @@ -125,141 +125,6 @@ static int put_dict (json_t *dict, const char *key, const char *val) return -1; } -/** - ** ops for using native Flux KVS for PMI KVS - ** This is used if pmi.kvs=native option is provided. - **/ - -static void native_lookup_continuation (flux_future_t *f, void *arg) -{ - struct shell_pmi *pmi = arg; - void *cli = flux_future_aux_get (f, "pmi_cli"); - const char *val = NULL; - - (void)flux_kvs_lookup_get (f, &val); // leave val=NULL on failure - pmi_simple_server_kvs_get_complete (pmi->server, cli, val); - flux_future_destroy (f); -} - -static int native_lookup (struct shell_pmi *pmi, const char *key, void *cli) -{ - char *nkey; - flux_future_t *f; - - if (asprintf (&nkey, "pmi.%s", key) < 0) - return -1; - if (!(f = flux_kvs_lookup (pmi->shell->h, NULL, 0, nkey))) - return -1; - if (flux_future_aux_set (f, "pmi_cli", cli, NULL) < 0) - goto error; - if (flux_future_then (f, -1, native_lookup_continuation, pmi) < 0) - goto error; - free (nkey); - return 0; -error: - ERRNO_SAFE_WRAP (free, nkey); - flux_future_destroy (f); - return -1; -} - -static void native_fence_continuation (flux_future_t *f, void *arg) -{ - struct shell_pmi *pmi = arg; - int rc = flux_future_get (f, NULL); - pmi_simple_server_barrier_complete (pmi->server, rc); - - flux_future_destroy (f); - json_object_clear (pmi->pending); -} - -static int native_fence (struct shell_pmi *pmi) -{ - flux_kvs_txn_t *txn; - const char *key; - json_t *val; - char *nkey; - int rc; - char name[64]; - static int seq = 0; - uintmax_t id = (uintmax_t)pmi->shell->jobid; - int size = pmi->shell->info->shell_size; - flux_future_t *f = NULL; - - if (!(txn = flux_kvs_txn_create ())) - return -1; - json_object_foreach (pmi->pending, key, val) { - if (asprintf (&nkey, "pmi.%s", key) < 0) - goto error; - rc = flux_kvs_txn_put (txn, 0, nkey, json_string_value (val)); - ERRNO_SAFE_WRAP (free, nkey); - if (rc < 0) - goto error; - } - (void)snprintf (name, sizeof (name), "%juPMI%d", id, seq++); - if (!(f = flux_kvs_fence (pmi->shell->h, NULL, 0, name, size, txn))) - goto error; - if (flux_future_then (f, -1, native_fence_continuation, pmi) < 0) - goto error; - flux_kvs_txn_destroy (txn); - return 0; -error: - flux_future_destroy (f); - flux_kvs_txn_destroy (txn); - return -1; -} - -/* pmi_simple_ops->kvs_put() signature */ -static int native_kvs_put (void *arg, - const char *kvsname, - const char *key, - const char *val) -{ - struct shell_pmi *pmi = arg; - - /* Hack to support "node scope" for partial PMI2 impl needed for Cray. - */ - if (strstarts (key, "local::")) - return put_dict (pmi->locals, key, val); - return put_dict (pmi->pending, key, val); -} - -/* pmi_simple_ops->barrier_enter() signature */ -static int native_barrier_enter (void *arg) -{ - struct shell_pmi *pmi = arg; - - if (pmi->shell->info->shell_size == 1) { - pmi_simple_server_barrier_complete (pmi->server, 0); - return 0; - } - if (native_fence (pmi) < 0) - return -1; // PMI_FAIL - return 0; -} - -/* pmi_simple_ops->kvs_get() signature */ -static int native_kvs_get (void *arg, - void *cli, - const char *kvsname, - const char *key) -{ - struct shell_pmi *pmi = arg; - json_t *o; - const char *val = NULL; - - if ((o = json_object_get (pmi->locals, key)) - || (o = json_object_get (pmi->pending, key))) { - val = json_string_value (o); - pmi_simple_server_kvs_get_complete (pmi->server, cli, val); - return 0; - } - if (pmi->shell->info->shell_size > 1) { - if (native_lookup (pmi, key, cli) == 0) - return 0; // response deferred - } - return -1; // PMI_ERR_INVALID_KEY -} - /** ** ops for using purpose-built dict exchange for PMI KVS ** This is used if pmi.kvs=exchange option is provided. @@ -538,14 +403,7 @@ static struct shell_pmi *pmi_create (flux_shell_t *shell, json_t *config) if (parse_args (config, &exchange_k, &kvs, &nomap) < 0) goto error; - if (streq (kvs, "native")) { - shell_pmi_ops.kvs_put = native_kvs_put; - shell_pmi_ops.kvs_get = native_kvs_get; - shell_pmi_ops.barrier_enter = native_barrier_enter; - if (shell->info->shell_rank == 0) - shell_warn ("using native Flux kvs implementation"); - } - else if (streq (kvs, "exchange")) { + if (streq (kvs, "exchange")) { shell_pmi_ops.kvs_put = exchange_kvs_put; shell_pmi_ops.kvs_get = exchange_kvs_get; shell_pmi_ops.barrier_enter = exchange_barrier_enter; diff --git a/t/Makefile.am b/t/Makefile.am index 0d4cf6e7eaec..f519e937304d 100644 --- a/t/Makefile.am +++ b/t/Makefile.am @@ -426,10 +426,7 @@ check_PROGRAMS = \ kvs/watch_disconnect \ kvs/watch_stream \ kvs/commit \ - kvs/fence_api \ kvs/transactionmerge \ - kvs/fence_namespace_remove \ - kvs/fence_invalid \ kvs/lookup_invalid \ kvs/commit_order \ kvs/issue1760 \ @@ -631,26 +628,11 @@ kvs_commit_CPPFLAGS = $(test_cppflags) kvs_commit_LDADD = $(test_ldadd) kvs_commit_LDFLAGS = $(test_ldflags) -kvs_fence_api_SOURCES = kvs/fence_api.c -kvs_fence_api_CPPFLAGS = $(test_cppflags) -kvs_fence_api_LDADD = $(test_ldadd) -kvs_fence_api_LDFLAGS = $(test_ldflags) - kvs_transactionmerge_SOURCES = kvs/transactionmerge.c kvs_transactionmerge_CPPFLAGS = $(test_cppflags) kvs_transactionmerge_LDADD = $(test_ldadd) kvs_transactionmerge_LDFLAGS = $(test_ldflags) -kvs_fence_namespace_remove_SOURCES = kvs/fence_namespace_remove.c -kvs_fence_namespace_remove_CPPFLAGS = $(test_cppflags) -kvs_fence_namespace_remove_LDADD = $(test_ldadd) -kvs_fence_namespace_remove_LDFLAGS = $(test_ldflags) - -kvs_fence_invalid_SOURCES = kvs/fence_invalid.c -kvs_fence_invalid_CPPFLAGS = $(test_cppflags) -kvs_fence_invalid_LDADD = $(test_ldadd) -kvs_fence_invalid_LDFLAGS = $(test_ldflags) - kvs_lookup_invalid_SOURCES = kvs/lookup_invalid.c kvs_lookup_invalid_CPPFLAGS = $(test_cppflags) kvs_lookup_invalid_LDADD = $(test_ldadd) diff --git a/t/kvs/.gitignore b/t/kvs/.gitignore index 3e8d42516e64..7b847308fc58 100644 --- a/t/kvs/.gitignore +++ b/t/kvs/.gitignore @@ -3,9 +3,6 @@ /commit_order /content-spam /dtree -/fence_api -/fence_invalid -/fence_namespace_remove /issue1760 /issue1876 /lookup_invalid diff --git a/t/kvs/commit.c b/t/kvs/commit.c index c405ab737482..ea1c0361a71c 100644 --- a/t/kvs/commit.c +++ b/t/kvs/commit.c @@ -39,15 +39,12 @@ typedef struct { static int count = -1; static int nthreads = -1; static char *prefix = NULL; -static bool fopt = false; static bool sopt = false; static bool nopt = false; static int nopt_divisor = 1; -static int fence_nprocs; -#define OPTIONS "f:sn:" +#define OPTIONS "sn:" static const struct option longopts[] = { - {"fence", required_argument, 0, 'f'}, {"stats", no_argument, 0, 's'}, {"nomerge", required_argument, 0, 'n'}, {0, 0, 0, 0}, @@ -55,7 +52,7 @@ static const struct option longopts[] = { static void usage (void) { - fprintf (stderr, "Usage: commit [--fence N] [--stats] [--nomerge N] nthreads count prefix\n"); + fprintf (stderr, "Usage: commit [--stats] [--nomerge N] nthreads count prefix\n"); exit (1); } @@ -69,7 +66,7 @@ double *ddup (double d) void *thread (void *arg) { thd_t *t = arg; - char *key, *fence_name = NULL; + char *key; int i, flags = 0; struct timespec t0; uint32_t rank; @@ -88,8 +85,6 @@ void *thread (void *arg) if (!(txn = flux_kvs_txn_create ())) log_err_exit ("flux_kvs_txn_create"); key = xasprintf ("%s.%"PRIu32".%d.%d", prefix, rank, t->n, i); - if (fopt) - fence_name = xasprintf ("%s-%d", prefix, i); if (sopt) monotime (&t0); if (flux_kvs_txn_pack (txn, 0, key, "i", 42) < 0) @@ -98,22 +93,13 @@ void *thread (void *arg) flags |= FLUX_KVS_NO_MERGE; else flags = 0; - if (fopt) { - if (!(f = flux_kvs_fence (t->h, NULL, flags, fence_name, - fence_nprocs, txn)) - || flux_future_get (f, NULL) < 0) - log_err_exit ("flux_kvs_fence"); - flux_future_destroy (f); - } else { - if (!(f = flux_kvs_commit (t->h, NULL, flags, txn)) - || flux_future_get (f, NULL) < 0) - log_err_exit ("flux_kvs_commit"); - flux_future_destroy (f); - } + if (!(f = flux_kvs_commit (t->h, NULL, flags, txn)) + || flux_future_get (f, NULL) < 0) + log_err_exit ("flux_kvs_commit"); + flux_future_destroy (f); if (sopt && zlist_append (t->perf, ddup (monotime_since (t0))) < 0) oom (); free (key); - free (fence_name); flux_kvs_txn_destroy (txn); } done: @@ -134,12 +120,6 @@ int main (int argc, char *argv[]) while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) { switch (ch) { - case 'f': - fopt = true; - fence_nprocs = strtoul (optarg, NULL, 10); - if (!fence_nprocs) - log_msg_exit ("fence value must be > 0"); - break; case 's': sopt = true; break; diff --git a/t/kvs/fence_api.c b/t/kvs/fence_api.c deleted file mode 100644 index 79615bb285fe..000000000000 --- a/t/kvs/fence_api.c +++ /dev/null @@ -1,213 +0,0 @@ -/************************************************************\ - * Copyright 2014 Lawrence Livermore National Security, LLC - * (c.f. AUTHORS, NOTICE.LLNS, COPYING) - * - * This file is part of the Flux resource manager framework. - * For details, see https://github.com/flux-framework. - * - * SPDX-License-Identifier: LGPL-3.0 -\************************************************************/ - -/* commit - performance test for KVS commits */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "src/common/libutil/oom.h" -#include "src/common/libutil/log.h" -#include "src/common/libutil/xzmalloc.h" -#include "src/common/libutil/monotime.h" -#include "src/common/libutil/tstat.h" -#include "ccan/str/str.h" - -typedef struct { - pthread_t t; - pthread_attr_t attr; - int n; - flux_t *h; - char *treeobj; - char *rootref; - int sequence; -} thd_t; - -static int count = -1; -static char *prefix = NULL; -static char *fence_name; -static bool syncflag = false; -static bool symlinkflag = false; -static const char *namespace = NULL; - -#define OPTIONS "n:Ss" -static const struct option longopts[] = { - {"namespace", required_argument, 0, 'n'}, - {"sync", no_argument, 0, 'S'}, - {"symlink", no_argument, 0, 's'}, - {0, 0, 0, 0}, -}; - -static void usage (void) -{ - fprintf (stderr, - "Usage: fence_api " - "[--sync] [--symlink] [--namespace=ns] " - "count prefix\n"); - exit (1); -} - -void *thread (void *arg) -{ - thd_t *t = arg; - char *key; - uint32_t rank; - flux_future_t *f; - flux_kvs_txn_t *txn; - const char *treeobj; - const char *rootref; - int sequence; - int flags = 0; - - if (!(t->h = flux_open (NULL, 0))) { - log_err ("%d: flux_open", t->n); - goto done; - } - - if (flux_get_rank (t->h, &rank) < 0) { - log_err ("%d: flux_get_rank", t->n); - goto done; - } - - /* create some key and write something to it */ - - if (!(txn = flux_kvs_txn_create ())) - log_err_exit ("flux_kvs_txn_create"); - - key = xasprintf ("%s.%"PRIu32".%d", prefix, rank, t->n); - - if (symlinkflag) { - if (flux_kvs_txn_symlink (txn, 0, key, NULL, "a-target") < 0) - log_err_exit ("%s", key); - } - else { - if (flux_kvs_txn_pack (txn, 0, key, "i", 42) < 0) - log_err_exit ("%s", key); - } - - if (syncflag) - flags |= FLUX_KVS_SYNC; - - if (!(f = flux_kvs_fence (t->h, namespace, flags, fence_name, - count, txn)) - || flux_future_get (f, NULL) < 0) - log_err_exit ("flux_kvs_fence"); - - /* save off fence root information */ - - if (flux_kvs_commit_get_treeobj (f, &treeobj) < 0) - log_err_exit ("flux_kvs_commit_get_treeobj"); - if (flux_kvs_commit_get_rootref (f, &rootref) < 0) - log_err_exit ("flux_kvs_commit_get_rootref"); - if (flux_kvs_commit_get_sequence (f, &sequence) < 0) - log_err_exit ("flux_kvs_commit_get_sequence"); - - t->treeobj = xstrdup (treeobj); - t->rootref = xstrdup (rootref); - t->sequence = sequence; - - flux_future_destroy (f); - - free (key); - flux_kvs_txn_destroy (txn); - -done: - if (t->h) - flux_close (t->h); - return NULL; -} - -int main (int argc, char *argv[]) -{ - thd_t *thd; - int i, ch, num, rc; - - log_init (argv[0]); - - while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) { - switch (ch) { - case 'S': - syncflag = true; - break; - case 's': - symlinkflag = true; - break; - case 'n': - namespace = optarg; - break; - default: - usage (); - } - } - if ((argc - optind) != 2) - usage (); - - count = strtoul (argv[optind], NULL, 10); - if (count <= 1) - log_msg_exit ("commit count must be > 1"); - prefix = argv[optind+1]; - - /* create a fence name for this test that is random-ish */ - srand (time (NULL)); - num = rand (); - fence_name = xasprintf ("%s-%d", prefix, num); - - thd = xzmalloc (sizeof (*thd) * count); - - for (i = 0; i < count; i++) { - thd[i].n = i; - if ((rc = pthread_attr_init (&thd[i].attr))) - log_errn (rc, "pthread_attr_init"); - if ((rc = pthread_create (&thd[i].t, &thd[i].attr, thread, &thd[i]))) - log_errn (rc, "pthread_create"); - } - - for (i = 0; i < count; i++) { - if ((rc = pthread_join (thd[i].t, NULL))) - log_errn (rc, "pthread_join"); - } - - /* compare results from all of the fences, the root ref info - * should all be the same - */ - for (i = 1; i < count; i++) { - if (!streq (thd[0].treeobj, thd[i].treeobj)) - log_msg_exit ("treeobj mismatch: %s != %s\n", - thd[0].treeobj, thd[i].treeobj); - if (!streq (thd[0].rootref, thd[i].rootref)) - log_msg_exit ("rootref mismatch: %s != %s\n", - thd[0].rootref, thd[i].rootref); - if (thd[0].sequence != thd[i].sequence) - log_msg_exit ("sequence mismatch: %d != %d\n", - thd[0].sequence, thd[i].sequence); - } - - for (i = 0; i < count; i++) { - free (thd[i].treeobj); - free (thd[i].rootref); - } - free (thd); - - log_fini (); - - return 0; -} - -/* - * vi:tabstop=4 shiftwidth=4 expandtab - */ diff --git a/t/kvs/fence_invalid.c b/t/kvs/fence_invalid.c deleted file mode 100644 index cd9b5d07fb25..000000000000 --- a/t/kvs/fence_invalid.c +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************\ - * Copyright 2014 Lawrence Livermore National Security, LLC - * (c.f. AUTHORS, NOTICE.LLNS, COPYING) - * - * This file is part of the Flux resource manager framework. - * For details, see https://github.com/flux-framework. - * - * SPDX-License-Identifier: LGPL-3.0 -\************************************************************/ - -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "src/common/libutil/oom.h" -#include "src/common/libutil/log.h" -#include "src/common/libutil/xzmalloc.h" -#include "src/common/libutil/monotime.h" -#include "src/common/libutil/tstat.h" - -static char *prefix = NULL; - -static void usage (void) -{ - fprintf (stderr, "Usage: fence_invalid prefix\n"); - exit (1); -} - -int main (int argc, char *argv[]) -{ - flux_t *h = NULL; - char *fence_name = NULL; - uint32_t rank; - char *key1 = NULL; - char *key2 = NULL; - flux_future_t *f1 = NULL; - flux_future_t *f2 = NULL; - flux_kvs_txn_t *txn1 = NULL; - flux_kvs_txn_t *txn2 = NULL; - - log_init (argv[0]); - - if (argc != 2) - usage (); - - prefix = argv[1]; - - if (!(h = flux_open (NULL, 0))) { - log_err_exit ("flux_open"); - goto done; - } - - if (flux_get_rank (h, &rank) < 0) { - log_err ("flux_get_rank"); - goto done; - } - - if (!(txn1 = flux_kvs_txn_create ())) { - log_err ("flux_kvs_txn_create"); - goto done; - } - - if (!(txn2 = flux_kvs_txn_create ())) { - log_err ("flux_kvs_txn_create"); - goto done; - } - - fence_name = xasprintf ("%s-%d", prefix, rank); - key1 = xasprintf ("%s.1.%d", prefix, rank); - key2 = xasprintf ("%s.2.%d", prefix, rank); - - if (flux_kvs_txn_pack (txn1, 0, key1, "i", 42) < 0) { - log_err ("%s: flux_kvs_txn_pack", key1); - goto done; - } - - if (flux_kvs_txn_pack (txn2, 0, key2, "i", 42) < 0) { - log_err ("%s: flux_kvs_txn_pack", key2); - goto done; - } - - /* alter flags to generate an error on second fence */ - - if (!(f1 = flux_kvs_fence (h, NULL, 0x10, fence_name, 2, txn1))) { - log_err ("flux_kvs_fence"); - goto done; - } - - if (!(f2 = flux_kvs_fence (h, NULL, 0x20, fence_name, 2, txn2))) { - log_err ("flux_kvs_fence"); - goto done; - } - - if (flux_future_get (f2, NULL) < 0) { - printf ("flux_future_get: %s\n", flux_strerror (errno)); - goto done; - } - -done: - flux_future_destroy (f1); - flux_future_destroy (f2); - free (key1); - free (key2); - free (fence_name); - flux_kvs_txn_destroy (txn1); - flux_kvs_txn_destroy (txn2); - flux_close (h); - log_fini (); - - return 0; -} - -/* - * vi:tabstop=4 shiftwidth=4 expandtab - */ diff --git a/t/kvs/fence_namespace_remove.c b/t/kvs/fence_namespace_remove.c deleted file mode 100644 index 7d0a1ea9884a..000000000000 --- a/t/kvs/fence_namespace_remove.c +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************\ - * Copyright 2014 Lawrence Livermore National Security, LLC - * (c.f. AUTHORS, NOTICE.LLNS, COPYING) - * - * This file is part of the Flux resource manager framework. - * For details, see https://github.com/flux-framework. - * - * SPDX-License-Identifier: LGPL-3.0 -\************************************************************/ - -/* ensure fences that have not yet completed get errors when a - * namespace is removed */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "src/common/libutil/oom.h" -#include "src/common/libutil/log.h" -#include "src/common/libutil/xzmalloc.h" -#include "src/common/libutil/monotime.h" -#include "src/common/libutil/tstat.h" - -static char *prefix = NULL; -static char *ns = NULL; - -static void usage (void) -{ - fprintf (stderr, "Usage: fence_namespace_remove namespace prefix\n"); - exit (1); -} - -int main (int argc, char *argv[]) -{ - flux_t *h = NULL; - uint32_t rank; - char *key = NULL; - char *fence_name = NULL; - flux_future_t *f = NULL; - flux_kvs_txn_t *txn = NULL; - - log_init (argv[0]); - - if (argc != 3) - usage (); - - ns = argv[1]; - prefix = argv[2]; - - if (!(h = flux_open (NULL, 0))) { - log_err_exit ("flux_open"); - goto done; - } - - if (flux_get_rank (h, &rank) < 0) { - log_err ("flux_get_rank"); - goto done; - } - - if (!(txn = flux_kvs_txn_create ())) { - log_err ("flux_kvs_txn_create"); - goto done; - } - - key = xasprintf ("%s.%d", prefix, rank); - fence_name = xasprintf ("%s-%d", prefix, rank); - - if (flux_kvs_txn_pack (txn, 0, key, "i", 42) < 0) { - log_err ("%s: flux_kvs_txn_pack", key); - goto done; - } - - /* nprocs = 2, but we call flux_kvs_fence only once, so the - * flux_future_get() below should hang until an error occurs - */ - - if (!(f = flux_kvs_fence (h, ns, 0, fence_name, 2, txn))) { - log_err ("flux_kvs_fence"); - goto done; - } - - if (flux_future_get (f, NULL) < 0) { - printf ("flux_future_get: %s\n", flux_strerror (errno)); - goto done; - } - -done: - flux_future_destroy (f); - free (key); - free (fence_name); - flux_kvs_txn_destroy (txn); - flux_close (h); - log_fini (); - - return 0; -} - -/* - * vi:tabstop=4 shiftwidth=4 expandtab - */ diff --git a/t/t1000-kvs.t b/t/t1000-kvs.t index 8d60501c62c7..a8a3307edc06 100755 --- a/t/t1000-kvs.t +++ b/t/t1000-kvs.t @@ -1257,9 +1257,6 @@ test_expect_success 'lookup-plus request with empty payload fails with EPROTO(71 test_expect_success 'commit request with empty payload fails with EPROTO(71)' ' ${RPC} kvs.commit 71 invalid_output && - grep "flux_future_get: Invalid argument" invalid_output -' - -test_expect_success 'kvs: test invalid fence arguments on rank 1' ' - flux exec -n -r 1 sh -c "${FLUX_BUILD_DIR}/t/kvs/fence_invalid invalidtest2" > invalid_output && - grep "flux_future_get: Invalid argument" invalid_output -' - # # test invalid lookup rpc # @@ -496,12 +474,11 @@ test_expect_success 'kvs: test invalid lookup rpc' ' # ensure pending requests are the expected number # -# fence invalid tests above linger a pending request on both rank 0 and rank 1 -test_expect_success 'kvs: 1 pending requests at end of tests before module removal' ' +test_expect_success 'kvs: 0 pending requests at end of tests before module removal' ' pendingcount=$(flux module stats -p pending_requests kvs) && - test $pendingcount -eq 1 && + test $pendingcount -eq 0 && pendingcount1=$(flux exec -n -r 1 sh -c "flux module stats -p pending_requests kvs") && - test $pendingcount1 -eq 1 + test $pendingcount1 -eq 0 ' # @@ -514,13 +491,7 @@ test_expect_success 'kvs: module stats returns reasonable transaction stats' ' echo $commitdata | jq -e ".min > 0" && echo $commitdata | jq -e ".max > 0" && echo $commitdata | jq -e ".mean > 0.0" && - echo $commitdata | jq -e ".stddev >= 0.0" && - fencedata=$(flux module stats -p transaction-opcount.fence kvs) && - echo $fencedata | jq -e ".count > 0" && - echo $fencedata | jq -e ".min > 0" && - echo $fencedata | jq -e ".max > 0" && - echo $fencedata | jq -e ".mean > 0.0" && - echo $fencedata | jq -e ".stddev >= 0.0" + echo $commitdata | jq -e ".stddev >= 0.0" ' # @@ -547,13 +518,7 @@ test_expect_success 'kvs: clear of transaction stats works' ' echo $commitdata | jq -e ".min == 0" && echo $commitdata | jq -e ".max == 0" && echo $commitdata | jq -e ".mean == 0.0" && - echo $commitdata | jq -e ".stddev == 0.0" && - fencedata=$(flux module stats -p transaction-opcount.fence kvs) && - echo $fencedata | jq -e ".count == 0" && - echo $fencedata | jq -e ".min == 0" && - echo $fencedata | jq -e ".max == 0" && - echo $fencedata | jq -e ".mean == 0.0" && - echo $fencedata | jq -e ".stddev == 0.0" + echo $commitdata | jq -e ".stddev == 0.0" ' test_expect_success NO_ASAN 'kvs: clear stats globally' ' diff --git a/t/t1003-kvs-stress.t b/t/t1003-kvs-stress.t index 40cc23504ca7..c3462c8cf0bc 100755 --- a/t/t1003-kvs-stress.t +++ b/t/t1003-kvs-stress.t @@ -72,29 +72,6 @@ test_expect_success 'kvs: 8 threads/rank each doing 100 put,commits in a loop, m $(basename ${SHARNESS_TEST_FILE}) ' -# fence test - -test_expect_success 'kvs: 8 threads/rank each doing 100 put,fence in a loop' ' - THREADS=8 && - flux exec -n ${FLUX_BUILD_DIR}/t/kvs/commit \ - --fence $((${SIZE}*${THREADS})) ${THREADS} 100 \ - $(basename ${SHARNESS_TEST_FILE}) -' - -test_expect_success 'kvs: 8 threads/rank each doing 100 put,fence in a loop, no merging' ' - THREADS=8 && - flux exec -n ${FLUX_BUILD_DIR}/t/kvs/commit \ - --fence $((${SIZE}*${THREADS})) --nomerge 1 ${THREADS} 100 \ - $(basename ${SHARNESS_TEST_FILE}) -' - -test_expect_success 'kvs: 8 threads/rank each doing 100 put,fence in a loop, mixed no merging' ' - THREADS=8 && - flux exec -n ${FLUX_BUILD_DIR}/t/kvs/commit \ - --fence $((${SIZE}*${THREADS})) --nomerge 2 ${THREADS} 100 \ - $(basename ${SHARNESS_TEST_FILE}) -' - # large dirs test_expect_success 'kvs: store 10,000 keys in one dir' ' diff --git a/t/t1004-kvs-namespace.t b/t/t1004-kvs-namespace.t index e46365c54d6e..ca858a396341 100755 --- a/t/t1004-kvs-namespace.t +++ b/t/t1004-kvs-namespace.t @@ -61,18 +61,6 @@ get_kvs_namespace_fails_all_ranks_loop() { return $(loophandlereturn $i) } -wait_fencecount_nonzero() { - i=0 - while (! flux exec -n -r $1 sh -c "flux module stats --parse namespace.$2.#transactions kvs" > /dev/null 2>& 1 \ - || [ "$(flux exec -n -r $1 sh -c "flux module stats --parse namespace.$2.#transactions kvs" 2> /dev/null)" = "0" ]) \ - && [ $i -lt ${KVS_WAIT_ITERS} ] - do - sleep 0.1 - i=$((i + 1)) - done - return $(loophandlereturn $i) -} - wait_versionwaiters_nonzero() { i=0 while (! flux module stats --parse namespace.$1.#versionwaiters kvs > /dev/null 2>&1 \ @@ -419,37 +407,6 @@ test_expect_success 'kvs: wait fails on invalid namespace on rank 1' ' ! flux exec -n -r 1 sh -c "flux kvs wait --namespace=$NAMESPACEBAD 1" ' -# When we call fence_namespace_remove, we know fence sent to server, -# but no way of knowing if server has accepted/processed fence. To -# avoid racing in this test, we iterate on the fence stat until it is -# non-zero to know it's ready for this test. -test_expect_success NO_CHAIN_LINT 'kvs: incomplete fence gets ENOTSUP when namespace is removed' ' - flux kvs namespace create $NAMESPACETMP-REMOVE-FENCE0 && - rm -f fence_out - ${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove $NAMESPACETMP-REMOVE-FENCE0 fence0 > fence_out & - watchpid=$! && - wait_fencecount_nonzero 0 $NAMESPACETMP-REMOVE-FENCE0 && - flux kvs namespace remove $NAMESPACETMP-REMOVE-FENCE0 && - wait $watchpid && - grep "flux_future_get: $(strerror_symbol ENOTSUP)" fence_out -' - - -# When we call fence_namespace_remove, we know fence sent to server, -# but no way of knowing if server has accepted/processed fence. To -# avoid racing in this test, we iterate on the fence stat until it is -# non-zero to know it's ready for this test. -test_expect_success NO_CHAIN_LINT 'kvs: incomplete fence on rank 1 gets ENOTSUP when namespace is removed' ' - flux kvs namespace create $NAMESPACETMP-REMOVE-FENCE1 && - rm -f fence_out - flux exec -n -r 1 sh -c "${FLUX_BUILD_DIR}/t/kvs/fence_namespace_remove $NAMESPACETMP-REMOVE-FENCE1 fence1" > fence_out & - watchpid=$! && - wait_fencecount_nonzero 1 $NAMESPACETMP-REMOVE-FENCE1 && - flux kvs namespace remove $NAMESPACETMP-REMOVE-FENCE1 && - wait $watchpid && - grep "flux_future_get: $(strerror_symbol ENOTSUP)" fence_out -' - test_expect_success NO_CHAIN_LINT 'kvs: wait recognizes removed namespace' ' flux kvs namespace create $NAMESPACETMP-REMOVE-WAIT && VERS=$(flux kvs version --namespace=$NAMESPACETMP-REMOVE-WAIT) && diff --git a/t/t1005-kvs-security.t b/t/t1005-kvs-security.t index 94de381e1750..2a50a69cb0fb 100755 --- a/t/t1005-kvs-security.t +++ b/t/t1005-kvs-security.t @@ -14,8 +14,6 @@ SIZE=$(test_size_large) test_under_flux ${SIZE} kvs echo "# $0: flux session size will be ${SIZE}" -FENCEAPI="${FLUX_BUILD_DIR}/t/kvs/fence_api" - DIR=test.a.b waitfile=${SHARNESS_TEST_SRCDIR}/scripts/waitfile.lua @@ -377,34 +375,6 @@ test_expect_success 'kvs: guest cannot make a symlink in the test ns on rank 1' grep "Operation not permitted" link2.err ' -test_expect_success 'kvs: owner can make a symlink via fence' ' - ${FENCEAPI} --namespace=$NAMESPACETMP-SYMLINK --symlink 4 fencetest1 -' - -test_expect_success 'kvs: guest cannot make a symlink via fence' ' - set_userid 9999 && - test_must_fail ${FENCEAPI} \ - --namespace=$NAMESPACETMP-SYMLINK --symlink 4 fencetest2 \ - 2>link5.err && - grep "Operation not permitted" link5.err && - unset_userid -' - -test_expect_success 'kvs: owner can make a symlink via fence on rank 1' ' - flux exec -n -r 1 \ - sh -c "${FENCEAPI} --namespace=$NAMESPACETMP-SYMLINK \ - --symlink 4 fencetest3" -' - -test_expect_success 'kvs: guest cannot make a symlink via fence on rank 1' ' - test_must_fail flux exec -n -r 1 \ - sh -c "FLUX_HANDLE_USERID=9999 FLUX_HANDLE_ROLEMASK=0x2 \ - ${FENCEAPI} --namespace=$NAMESPACETMP-SYMLINK \ - --symlink 4 fencetest4" \ - 2>link6.err && - grep "Operation not permitted" link6.err -' - # # Basic tests, user can't perform non-namespace operations # diff --git a/t/t1010-kvs-commit-sync.t b/t/t1010-kvs-commit-sync.t index db3ba60d82a9..0411cddcaa8b 100755 --- a/t/t1010-kvs-commit-sync.t +++ b/t/t1010-kvs-commit-sync.t @@ -46,29 +46,12 @@ test_expect_success 'kvs: checkpoint of kvs-primary should match rootref' ' test_cmp syncblob.out checkpoint.out ' -test_expect_success 'kvs: fence some data to kvs and sync it' ' - ${FLUX_BUILD_DIR}/t/kvs/fence_api --sync 4 apisynctest -' - -test_expect_success 'kvs: rootref of kvs-primary should match rootref' ' - flux kvs getroot -b > fenceroot.exp && - checkpoint_get kvs-primary | jq -r .value.rootref > fenceroot.out && - test_cmp fenceroot.exp fenceroot.out -' - test_expect_success 'kvs: sync fails against non-primary namespace' ' flux kvs namespace create ${TESTNAMESPACE} && flux kvs put --namespace=${TESTNAMESPACE} a=10 && test_must_fail flux kvs put --namespace=${TESTNAMESPACE} --sync b=11 ' -test_expect_success 'kvs: sync fence fails against non-primary namespace' ' - ${FLUX_BUILD_DIR}/t/kvs/fence_api \ - --namespace=${TESTNAMESPACE} 4 apisynctestns && - test_must_fail ${FLUX_BUILD_DIR}/t/kvs/fence_api \ - --namespace=${TESTNAMESPACE} --sync 4 apisynctestns -' - test_expect_success 'kvs: unload content-sqlite' ' flux module remove content-sqlite ' diff --git a/t/t3002-pmi.t b/t/t3002-pmi.t index 5e1c7301c35d..21577e87988a 100755 --- a/t/t3002-pmi.t +++ b/t/t3002-pmi.t @@ -113,18 +113,10 @@ test_expect_success 'kvstest fails with -o pmi-simple.kvs=unknown' ' test_must_fail flux run -o pmi-simple.kvs=unknown ${kvstest} ' -test_expect_success 'kvstest works with -o pmi-simple.kvs=native' ' - flux run -n${SIZE} -N${SIZE} -o pmi-simple.kvs=native ${kvstest} -' - test_expect_success 'kvstest -N8 works' ' flux run -n${SIZE} -N${SIZE} ${kvstest} -N8 ' -test_expect_success 'kvstest -N8 works with -o pmi-simple.kvs=native' ' - flux run -n${SIZE} -N${SIZE} -o pmi-simple.kvs=native ${kvstest} -N8 -' - test_expect_success 'verbose=2 shell option enables PMI server side tracing' ' flux run -n${SIZE} -N${SIZE} -o verbose=2 ${kvstest} 2>trace.out && grep "cmd=finalize_ack" trace.out