From db0d5ba856e66ed7bd77be6ea1958c6ed762e6b4 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Fri, 5 Aug 2022 13:47:47 -0700 Subject: [PATCH] kvs: add root_seq to kvstxn_process() Problem: In the near future we will need to root sequence number in kvstxn_process(), but it is not available. Solution: Add root_seq parameter to kvstxn_process(). Update callers appropriately. --- src/modules/kvs/kvs.c | 4 +- src/modules/kvs/kvstxn.c | 4 +- src/modules/kvs/kvstxn.h | 4 +- src/modules/kvs/test/kvstxn.c | 164 +++++++++++++++++----------------- 4 files changed, 91 insertions(+), 85 deletions(-) diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index eb78bf270fb4..4c558c7871a9 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -963,7 +963,9 @@ static void kvstxn_apply (kvstxn_t *kt) if ((errnum = kvstxn_get_aux_errnum (kt))) goto done; - if ((ret = kvstxn_process (kt, root->ref)) == KVSTXN_PROCESS_ERROR) { + if ((ret = kvstxn_process (kt, + root->ref, + root->seq)) == KVSTXN_PROCESS_ERROR) { errnum = kvstxn_get_errnum (kt); goto done; } diff --git a/src/modules/kvs/kvstxn.c b/src/modules/kvs/kvstxn.c index c379cb75e7b8..13a8cd3438e8 100644 --- a/src/modules/kvs/kvstxn.c +++ b/src/modules/kvs/kvstxn.c @@ -842,7 +842,9 @@ static json_t *keys_from_ops (json_t *ops) return NULL; } -kvstxn_process_t kvstxn_process (kvstxn_t *kt, const char *root_ref) +kvstxn_process_t kvstxn_process (kvstxn_t *kt, + const char *root_ref, + int root_seq) { /* Incase user calls kvstxn_process() again */ if (kt->errnum) diff --git a/src/modules/kvs/kvstxn.h b/src/modules/kvs/kvstxn.h index ec63a9ea4f47..368f2f79bfd8 100644 --- a/src/modules/kvs/kvstxn.h +++ b/src/modules/kvs/kvstxn.h @@ -113,7 +113,9 @@ json_t *kvstxn_get_keys (kvstxn_t *kt); * on completion, call kvstxn_get_newroot_ref() to get reference to * new root to be stored. */ -kvstxn_process_t kvstxn_process (kvstxn_t *kt, const char *root_ref); +kvstxn_process_t kvstxn_process (kvstxn_t *kt, + const char *root_ref, + int root_seq); /* on stall, iterate through all missing refs that the caller should * load into the cache diff --git a/src/modules/kvs/test/kvstxn.c b/src/modules/kvs/test/kvstxn.c index 1095e8545a58..ec4284bae905 100644 --- a/src/modules/kvs/test/kvstxn.c +++ b/src/modules/kvs/test/kvstxn.c @@ -732,7 +732,7 @@ void kvstxn_corner_case_tests (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_ERROR + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_ERROR && kvstxn_get_errnum (kt) == EINVAL, "kvstxn_sync_checkpoint returns EINVAL on FLUX_KVS_SYNC " "with non-default namespace"); @@ -839,7 +839,7 @@ void kvstxn_basic_kvstxn_process_test (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, @@ -848,7 +848,7 @@ void kvstxn_basic_kvstxn_process_test (void) ok (count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -896,7 +896,7 @@ void kvstxn_basic_kvstxn_process_test_empty_ops (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -956,7 +956,7 @@ void kvstxn_basic_kvstxn_process_test_internal_flags (void) ok (flags == KVSTXN_INTERNAL_FLAG_NO_PUBLISH, "kvstxn_get_internal_flags returns correct flags"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1007,7 +1007,7 @@ void kvstxn_basic_kvstxn_process_test_normalization (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, @@ -1016,7 +1016,7 @@ void kvstxn_basic_kvstxn_process_test_normalization (void) ok (count == 2, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1072,7 +1072,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, @@ -1081,7 +1081,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions (void) ok (count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1097,7 +1097,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -1109,7 +1109,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions (void) ok (count == 2, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1174,7 +1174,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions_merge (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, @@ -1187,7 +1187,7 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions_merge (void) ok (count == 3, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1207,13 +1207,13 @@ void kvstxn_basic_kvstxn_process_test_multiple_transactions_merge (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns NULL, no more kvstxns"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1265,7 +1265,7 @@ void kvstxn_basic_kvstxn_process_test_invalid_transaction (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready transaction"); - ok (kvstxn_process (ktbad, rootref) == KVSTXN_PROCESS_ERROR + ok (kvstxn_process (ktbad, rootref, 0) == KVSTXN_PROCESS_ERROR && kvstxn_get_errnum (ktbad) == EINVAL, "kvstxn_process fails on bad kvstxn"); @@ -1305,11 +1305,11 @@ void kvstxn_basic_root_not_dir (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); /* error is caught continuously */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR again"); ok (kvstxn_get_errnum (kt) == EINVAL, @@ -1382,11 +1382,11 @@ void kvstxn_process_root_missing (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); /* user forgot to call kvstxn_iter_missing_refs() test */ - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS again"); rd.cache = cache; @@ -1395,17 +1395,17 @@ void kvstxn_process_root_missing (void) ok (kvstxn_iter_missing_refs (kt, rootref_cb, &rd) == 0, "kvstxn_iter_missing_refs works for dirty cache entries"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); /* user forgot to call kvstxn_iter_dirty_cache_entries() test */ - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES again"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1483,11 +1483,11 @@ void kvstxn_process_missing_ref (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); /* user forgot to call kvstxn_iter_missing_refs() test */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS again"); ok (kvstxn_iter_missing_refs (kt, missingref_count_cb, &count) == 0, @@ -1503,17 +1503,17 @@ void kvstxn_process_missing_ref (void) (void)cache_insert (cache, entry); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); /* user forgot to call kvstxn_iter_dirty_cache_entries() test */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES again"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1626,7 +1626,7 @@ void kvstxn_process_multiple_missing_ref (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); ok (kvstxn_iter_missing_refs (kt, missingref_count_cb, &count) == 0, @@ -1652,13 +1652,13 @@ void kvstxn_process_multiple_missing_ref (void) (void)cache_insert (cache, entry); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1750,7 +1750,7 @@ void kvstxn_process_multiple_identical_missing_ref (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); ok (kvstxn_iter_missing_refs (kt, missingref_count_cb, &count) == 0, @@ -1766,13 +1766,13 @@ void kvstxn_process_multiple_identical_missing_ref (void) (void)cache_insert (cache, entry); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1860,7 +1860,7 @@ void kvstxn_process_missing_ref_removed (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); ok (kvstxn_iter_missing_refs (kt, missingref_count_cb, &count) == 0, @@ -1876,13 +1876,13 @@ void kvstxn_process_missing_ref_removed (void) (void)cache_insert (cache, entry); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -1967,7 +1967,7 @@ void kvstxn_process_error_callbacks (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); errno = 0; @@ -1979,7 +1979,7 @@ void kvstxn_process_error_callbacks (void) * kvstxn_process call */ (void)cache_insert (cache, create_cache_entry_treeobj (dir_ref, dir)); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); errno = 0; @@ -2067,7 +2067,7 @@ void kvstxn_process_error_callbacks_partway (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); errno = 0; @@ -2117,11 +2117,11 @@ void kvstxn_process_invalid_operation (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); /* error is caught continuously */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR again"); ok (kvstxn_get_errnum (kt) == EINVAL, @@ -2171,7 +2171,7 @@ void kvstxn_process_malformed_operation (void) */ ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR && kvstxn_get_errnum (kt) == EPROTO, "kvstxn_process encountered EPROTO error"); @@ -2212,11 +2212,11 @@ void kvstxn_process_invalid_hash (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); /* verify kvstxn_process() does not continue processing */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR on second call"); ok (kvstxn_get_errnum (kt) == EINVAL, @@ -2283,13 +2283,13 @@ void kvstxn_process_follow_link_no_namespace (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2351,13 +2351,13 @@ void kvstxn_process_follow_link_namespace (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2387,7 +2387,7 @@ void kvstxn_process_follow_link_namespace (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EINVAL, @@ -2445,13 +2445,13 @@ void kvstxn_process_dirval_test (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2522,13 +2522,13 @@ void kvstxn_process_delete_test (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2580,7 +2580,7 @@ void kvstxn_process_delete_nosubdir_test (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2651,7 +2651,7 @@ void kvstxn_process_delete_filevalinpath_test (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2722,11 +2722,11 @@ void kvstxn_process_bad_dirrefs (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); /* error is caught continuously */ - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR again"); ok (kvstxn_get_errnum (kt) == ENOTRECOVERABLE, @@ -2805,7 +2805,7 @@ void kvstxn_process_big_fileval (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); cache_count.treeobj_count = 0; @@ -2820,7 +2820,7 @@ void kvstxn_process_big_fileval (void) ok (cache_count.total_count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2844,7 +2844,7 @@ void kvstxn_process_big_fileval (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); cache_count.treeobj_count = 0; @@ -2862,7 +2862,7 @@ void kvstxn_process_big_fileval (void) ok (cache_count.total_count == 2, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -2975,13 +2975,13 @@ void kvstxn_process_giant_dir (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_noop_cb, NULL) == 0, "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3058,7 +3058,7 @@ void kvstxn_process_append (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -3070,7 +3070,7 @@ void kvstxn_process_append (void) ok (count == 3, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3091,7 +3091,7 @@ void kvstxn_process_append (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -3103,7 +3103,7 @@ void kvstxn_process_append (void) ok (count == 2, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3124,7 +3124,7 @@ void kvstxn_process_append (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -3135,7 +3135,7 @@ void kvstxn_process_append (void) ok (count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3199,7 +3199,7 @@ void kvstxn_process_append_errors (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EISDIR, @@ -3216,7 +3216,7 @@ void kvstxn_process_append_errors (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EOPNOTSUPP, @@ -3233,7 +3233,7 @@ void kvstxn_process_append_errors (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EOPNOTSUPP, @@ -3322,7 +3322,7 @@ void kvstxn_process_append_no_duplicate (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_LOAD_MISSING_REFS, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_LOAD_MISSING_REFS, "kvstxn_process returns KVSTXN_PROCESS_LOAD_MISSING_REFS"); ok (kvstxn_iter_missing_refs (kt, missingref_count_cb, &count) == 0, @@ -3338,7 +3338,7 @@ void kvstxn_process_append_no_duplicate (void) (void)cache_insert (cache, entry); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -3351,7 +3351,7 @@ void kvstxn_process_append_no_duplicate (void) ok (count == 4, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, root_ref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, root_ref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3416,7 +3416,7 @@ void kvstxn_process_fallback_merge (void) ok (kvstxn_fallback_mergeable (kt) == true, "kvstxn_fallback_mergeable returns true on merged transaction"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, @@ -3425,7 +3425,7 @@ void kvstxn_process_fallback_merge (void) ok (count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3456,7 +3456,7 @@ void kvstxn_process_fallback_merge (void) ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready transaction"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EINVAL, @@ -3479,7 +3479,7 @@ void kvstxn_process_fallback_merge (void) ok (kvstxn_fallback_mergeable (kt) == false, "kvstxn_fallback_mergeable returns false on unmerged transaction"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); count = 0; @@ -3489,7 +3489,7 @@ void kvstxn_process_fallback_merge (void) ok (count == 1, "correct number of cache entries were dirty"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_FINISHED, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_FINISHED, "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, @@ -3511,7 +3511,7 @@ void kvstxn_process_fallback_merge (void) ok (kvstxn_fallback_mergeable (kt) == false, "kvstxn_fallback_mergeable returns false on unmerged transaction"); - ok (kvstxn_process (kt, rootref) == KVSTXN_PROCESS_ERROR, + ok (kvstxn_process (kt, rootref, 0) == KVSTXN_PROCESS_ERROR, "kvstxn_process returns KVSTXN_PROCESS_ERROR"); ok (kvstxn_get_errnum (kt) == EINVAL,