From dbce36553ae7f2c17edcf6976c951e9a25b36727 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Tue, 28 Jan 2025 12:45:21 -0800 Subject: [PATCH 1/5] broker: remove heartbeat_rate variable Problem: The heartbeat function of the broker was moved into its own module, however a lingering heartbeat variable still exists. Remove the lingering variable. --- src/broker/broker.h | 1 - 1 file changed, 1 deletion(-) 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; From 1c287444b5b512918a1034dc967c2a18756bad6a Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Thu, 30 Jan 2025 10:30:47 -0800 Subject: [PATCH 2/5] doc: document flux_kvs_commit_get_rootref(3) Problem: flux_kvs_commit_get_rootref(3) was missing in documentation. Add the function to flux_kvs_commit(3). --- doc/Makefile.am | 1 + doc/man3/flux_kvs_commit.rst | 24 +++++++++++++++--------- doc/manpages.py | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) 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), From 49264c23a19d64fe20fbdda7678dfc2ee014f99c Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Wed, 29 Jan 2025 11:14:35 -0800 Subject: [PATCH 3/5] kvs: refactor the treq_set_processed() function Problem: The treq_set_processed() function allows the caller to set true vs false on a transaction. However, we only set "true" on a transaction, never "false". Refactor the treq_set_processed() to treq_mark_processed() where the function no longer takes a boolean flag. The function simply sets the processed flag to true. --- src/modules/kvs/kvs.c | 6 +++--- src/modules/kvs/test/treq.c | 2 +- src/modules/kvs/treq.c | 4 ++-- src/modules/kvs/treq.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) 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/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 */ From a1693a29145795b0e4a2c79f5eed46fcf2fb7919 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Thu, 30 Jan 2025 12:19:31 -0800 Subject: [PATCH 4/5] kvs/test: update merge test descriptions Problem: A number of merge test descriptions are identical and/or not descriptive of the test. Update the merge test descriptions. --- src/modules/kvs/test/kvstxn.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) 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); From bf45b00ca97fa08d6f7ef8f02d7f9903981807f9 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Wed, 29 Jan 2025 15:46:50 -0800 Subject: [PATCH 5/5] t/kvs: update .gitignore Problem: The .gitignore file in t/kvs was out of date. Solution: Remove binaries that no longer exist and add missing binaries. --- t/kvs/.gitignore | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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