diff --git a/doc/Makefile.am b/doc/Makefile.am index eae564d8718c..76884f7c73f6 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -285,6 +285,7 @@ MAN3_FILES_SECONDARY = \ 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 \ man3/flux_kvs_txn_destroy.3 \ man3/flux_kvs_txn_put.3 \ diff --git a/doc/man3/flux_kvs_commit.rst b/doc/man3/flux_kvs_commit.rst index 59b3e216c493..e51ddb25eeba 100644 --- a/doc/man3/flux_kvs_commit.rst +++ b/doc/man3/flux_kvs_commit.rst @@ -26,6 +26,9 @@ SYNOPSIS 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 *seq); Link with :command:`-lflux-core`. @@ -57,22 +60,25 @@ complete. 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`, 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`. +: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`. In addition to checking for success or failure, -:func:`flux_kvs_commit_get_treeobj` and :func:`flux_kvs_commit_get_sequence` -can return information about the root snapshot that the commit or -fence has completed its transaction on. +: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. :func:`flux_kvs_commit_get_treeobj` obtains the root hash in the form of an RFC 11 *dirref* treeobj, suitable to be passed to :man3:`flux_kvs_lookupat`. +:func:`flux_kvs_commit_get_rootref` retrieves the blobref for the root. + :func:`flux_kvs_commit_get_sequence` retrieves the monotonic sequence number for the root. diff --git a/doc/manpages.py b/doc/manpages.py index 63acbdfbfbd8..43cf27d0388f 100644 --- a/doc/manpages.py +++ b/doc/manpages.py @@ -129,6 +129,7 @@ ('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), ('man3/flux_kvs_commit', 'flux_kvs_commit', 'commit a KVS transaction', [author], 3), ('man3/flux_kvs_copy', 'flux_kvs_move', 'copy/move a KVS key', [author], 3), diff --git a/src/broker/broker.h b/src/broker/broker.h index c51c91e9442f..c389304fdb8a 100644 --- a/src/broker/broker.h +++ b/src/broker/broker.h @@ -43,7 +43,6 @@ struct broker { zlist_t *sigwatchers; struct service_switch *services; struct brokercfg *config; - double heartbeat_rate; struct subhash *sub; /* subscriptions for internal services */ struct content_cache *cache; struct publisher *publisher; diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index 4cd5043d6552..fdf27d4ce1b2 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -1805,7 +1805,7 @@ static void commit_request_cb (flux_t *h, * the ready queue. We don't need to call * treq_count_reached() b/c this is a commit and nprocs is 1 */ - treq_set_processed (tr, true); + treq_mark_processed (tr); if (kvstxn_mgr_add_transaction (root->ktm, treq_get_name (tr), @@ -1915,7 +1915,7 @@ static void relayfence_request_cb (flux_t *h, /* we use this flag to indicate if a treq has been added to * the ready queue */ - treq_set_processed (tr, true); + treq_mark_processed (tr); if (kvstxn_mgr_add_transaction (root->ktm, treq_get_name (tr), @@ -2036,7 +2036,7 @@ static void fence_request_cb (flux_t *h, /* we use this flag to indicate if a treq has been added to * the ready queue */ - treq_set_processed (tr, true); + treq_mark_processed (tr); if (kvstxn_mgr_add_transaction (root->ktm, treq_get_name (tr), diff --git a/src/modules/kvs/test/kvstxn.c b/src/modules/kvs/test/kvstxn.c index 301925aaa337..89317db0cd8e 100644 --- a/src/modules/kvs/test/kvstxn.c +++ b/src/modules/kvs/test/kvstxn.c @@ -517,7 +517,7 @@ void kvstxn_mgr_merge_tests (void) ops, FLUX_KVS_NO_MERGE, 0, - "unmerged transaction"); + "unmerged transaction (no merge 1)"); json_decref (names); json_decref (ops); @@ -539,7 +539,12 @@ void kvstxn_mgr_merge_tests (void) ops = json_array (); ops_append (ops, "key1", "1", 0); - verify_ready_kvstxn (ktm, names, ops, 0, 0, "unmerged transaction"); + verify_ready_kvstxn (ktm, + names, + ops, + 0, + 0, + "unmerged transaction (no merge 2)"); json_decref (names); json_decref (ops); @@ -566,7 +571,7 @@ void kvstxn_mgr_merge_tests (void) ops, FLUX_KVS_SYNC, 0, - "unmerged transaction"); + "unmerged transaction (sync 1)"); json_decref (names); json_decref (ops); @@ -588,7 +593,12 @@ void kvstxn_mgr_merge_tests (void) ops = json_array (); ops_append (ops, "key1", "1", 0); - verify_ready_kvstxn (ktm, names, ops, 0, 0, "unmerged transaction"); + verify_ready_kvstxn (ktm, + names, + ops, + 0, + 0, + "unmerged transaction (sync 2)"); json_decref (names); json_decref (ops); @@ -610,7 +620,12 @@ void kvstxn_mgr_merge_tests (void) ops = json_array (); ops_append (ops, "key1", "1", 0); - verify_ready_kvstxn (ktm, names, ops, 0, 0, "unmerged fence"); + verify_ready_kvstxn (ktm, + names, + ops, + 0, + 0, + "unmerged transaction (diff flags)"); json_decref (names); json_decref (ops); diff --git a/src/modules/kvs/test/treq.c b/src/modules/kvs/test/treq.c index 76c6cbe2bd1f..0eb7b50c0741 100644 --- a/src/modules/kvs/test/treq.c +++ b/src/modules/kvs/test/treq.c @@ -111,7 +111,7 @@ void treq_basic_tests (void) ok (treq_get_processed (tr) == false, "treq_get_processed returns false initially"); - treq_set_processed (tr, true); + treq_mark_processed (tr); ok (treq_get_processed (tr) == true, "treq_get_processed returns true"); diff --git a/src/modules/kvs/treq.c b/src/modules/kvs/treq.c index 1f6532e390f3..e616cca132a0 100644 --- a/src/modules/kvs/treq.c +++ b/src/modules/kvs/treq.c @@ -343,9 +343,9 @@ bool treq_get_processed (treq_t *tr) return tr->processed; } -void treq_set_processed (treq_t *tr, bool p) +void treq_mark_processed (treq_t *tr) { - tr->processed = p; + tr->processed = true; } /* diff --git a/src/modules/kvs/treq.h b/src/modules/kvs/treq.h index 2cdccf4bcdcc..eb1c857358e0 100644 --- a/src/modules/kvs/treq.h +++ b/src/modules/kvs/treq.h @@ -91,7 +91,7 @@ int treq_iter_request_copies (treq_t *tr, treq_msg_cb cb, void *data); /* convenience processing flag */ bool treq_get_processed (treq_t *tr); -void treq_set_processed (treq_t *tr, bool p); +void treq_mark_processed (treq_t *tr); #endif /* !_FLUX_KVS_TREQ_H */ diff --git a/t/kvs/.gitignore b/t/kvs/.gitignore index d8b8b473dc7f..3e8d42516e64 100644 --- a/t/kvs/.gitignore +++ b/t/kvs/.gitignore @@ -1,10 +1,17 @@ -/asyncfence -/basic /blobref /commit +/commit_order +/content-spam /dtree -/getas -/hashtest +/fence_api +/fence_invalid +/fence_namespace_remove +/issue1760 +/issue1876 +/lookup_invalid +/setrootevents /torture -/watch +/transactionmerge +/waitcreate_cancel /watch_disconnect +/watch_stream