Skip to content

Commit

Permalink
Merge pull request #6628 from chu11/kvs_cleanup5
Browse files Browse the repository at this point in the history
kvs: move "wait_version" API into "kvsroot" API
  • Loading branch information
mergify[bot] authored Feb 13, 2025
2 parents be350d6 + e70e3c7 commit 9029a38
Show file tree
Hide file tree
Showing 8 changed files with 381 additions and 518 deletions.
17 changes: 1 addition & 16 deletions src/modules/kvs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ libkvs_la_SOURCES = \
kvstxn.h \
kvsroot.c \
kvsroot.h \
kvs_wait_version.c \
kvs_wait_version.h \
kvs_checkpoint.c \
kvs_checkpoint.h

Expand All @@ -38,8 +36,7 @@ TESTS = \
test_cache.t \
test_lookup.t \
test_kvstxn.t \
test_kvsroot.t \
test_kvs_wait_version.t
test_kvsroot.t

test_ldadd = \
$(builddir)/libkvs.la \
Expand Down Expand Up @@ -116,16 +113,4 @@ test_kvsroot_t_LDADD = \
test_kvsroot_t_LDFLAGS = \
$(test_ldflags)

test_kvs_wait_version_t_SOURCES = test/kvs_wait_version.c
test_kvs_wait_version_t_CPPFLAGS = $(test_cppflags)
test_kvs_wait_version_t_LDADD = \
$(top_builddir)/src/modules/kvs/kvs_wait_version.o \
$(top_builddir)/src/modules/kvs/waitqueue.o \
$(top_builddir)/src/modules/kvs/kvsroot.o \
$(top_builddir)/src/modules/kvs/kvstxn.o \
$(top_builddir)/src/modules/kvs/cache.o \
$(test_ldadd)
test_kvs_wait_version_t_LDFLAGS = \
$(test_ldflags)

EXTRA_DIST = README.md
7 changes: 3 additions & 4 deletions src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "lookup.h"
#include "kvstxn.h"
#include "kvsroot.h"
#include "kvs_wait_version.h"
#include "kvs_checkpoint.h"

/* heartbeat_sync_cb() is called periodically to manage cached content
Expand Down Expand Up @@ -1168,7 +1167,7 @@ static int heartbeat_root_cb (struct kvsroot *root, void *arg)
double now = flux_reactor_now (flux_get_reactor (ctx->h));

if (root->remove) {
if (!zlist_size (root->wait_version_list)
if (!zlistx_size (root->wait_version_list)
&& !zhashx_size (root->transaction_requests)
&& !kvstxn_mgr_ready_transaction_count (root->ktm)) {

Expand All @@ -1186,7 +1185,7 @@ static int heartbeat_root_cb (struct kvsroot *root, void *arg)
&& !root->remove
&& !root->is_primary
&& (now - root->last_update_time) > max_namespace_age
&& !zlist_size (root->wait_version_list)
&& !zlistx_size (root->wait_version_list)
&& !zhashx_size (root->transaction_requests)
&& !kvstxn_mgr_ready_transaction_count (root->ktm)) {
/* remove a root if it not the primary one, has timed out
Expand Down Expand Up @@ -1991,7 +1990,7 @@ static int stats_get_root_cb (struct kvsroot *root, void *arg)

if (!(s = json_pack ("{ s:i s:i s:i s:i s:i }",
"#versionwaiters",
zlist_size (root->wait_version_list),
zlistx_size (root->wait_version_list),
"#no-op stores",
kvstxn_mgr_get_noop_stores (root->ktm),
"#transactions",
Expand Down
165 changes: 0 additions & 165 deletions src/modules/kvs/kvs_wait_version.c

This file was deleted.

45 changes: 0 additions & 45 deletions src/modules/kvs/kvs_wait_version.h

This file was deleted.

Loading

0 comments on commit 9029a38

Please sign in to comment.