diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index 593c824fb822..2c113177bb2e 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -1042,10 +1042,6 @@ static void kvstxn_apply (kvstxn_t *kt) } else { fallback = kvstxn_fallback_mergeable (kt); - flux_log (ctx->h, LOG_ERR, "kvstxn failed: %s%s", - flux_strerror (errnum), - fallback ? " (is fallbackable)" : ""); - /* if merged transaction is fallbackable, ignore the fallback option * if it's an extreme "death" like error. */ diff --git a/src/modules/kvs/test/kvstxn.c b/src/modules/kvs/test/kvstxn.c index 9a70d1a301e0..0d8c600ceae7 100644 --- a/src/modules/kvs/test/kvstxn.c +++ b/src/modules/kvs/test/kvstxn.c @@ -2536,11 +2536,11 @@ void kvstxn_namespace_prefix (void) kvstxn_mgr_remove_transaction (ktm, kt, false); - /* Third, test if invalid prefix across multiple prefixes fails */ + /* Third, test if valid & indentical prefix across multiple operations works */ ops = json_array (); ops_append (ops, "ns:primary/key3", "3", 0); - ops_append (ops, "ns:foobar/key4", "4", 0); + ops_append (ops, "ns:primary/key4", "4", 0); ok (kvstxn_mgr_add_transaction (ktm, "transaction3", @@ -2550,6 +2550,44 @@ void kvstxn_namespace_prefix (void) json_decref (ops); + ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, + "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); + + ok (kvstxn_process (kt, 1, rootref) == KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES, + "kvstxn_process returns KVSTXN_PROCESS_DIRTY_CACHE_ENTRIES"); + + count = 0; + ok (kvstxn_iter_dirty_cache_entries (kt, cache_count_dirty_cb, &count) == 0, + "kvstxn_iter_dirty_cache_entries works for dirty cache entries"); + + ok (count == 1, + "correct number of cache entries were dirty"); + + ok (kvstxn_process (kt, 1, rootref) == KVSTXN_PROCESS_FINISHED, + "kvstxn_process returns KVSTXN_PROCESS_FINISHED"); + + ok ((newroot = kvstxn_get_newroot_ref (kt)) != NULL, + "kvstxn_get_newroot_ref returns != NULL when processing complete"); + + verify_value (cache, krm, KVS_PRIMARY_NAMESPACE, newroot, "key3", "3"); + verify_value (cache, krm, KVS_PRIMARY_NAMESPACE, newroot, "key4", "4"); + + kvstxn_mgr_remove_transaction (ktm, kt, false); + + /* Fourth, test if invalid prefix across multiple prefixes fails */ + + ops = json_array (); + ops_append (ops, "ns:primary/key5", "5", 0); + ops_append (ops, "ns:foobar/key6", "6", 0); + + ok (kvstxn_mgr_add_transaction (ktm, + "transaction4", + ops, + 0) == 0, + "kvstxn_mgr_add_transaction works"); + + json_decref (ops); + ok ((kt = kvstxn_mgr_get_ready_transaction (ktm)) != NULL, "kvstxn_mgr_get_ready_transaction returns ready kvstxn"); diff --git a/t/t1004-kvs-namespace.t b/t/t1004-kvs-namespace.t index 10b4023ccfe9..c4164764aabc 100755 --- a/t/t1004-kvs-namespace.t +++ b/t/t1004-kvs-namespace.t @@ -402,6 +402,10 @@ test_expect_success 'kvs: put - fails across multiple namespaces' ' ! flux kvs put ns:${NAMESPACEPREFIX}-1/$DIR.puttest.a=1 ns:${NAMESPACEPREFIX}-2/$DIR.puttest.b=2 ' +test_expect_success 'kvs: put - success multiple namespace prefixes identical' ' + flux kvs put ns:${NAMESPACEPREFIX}-2/$DIR.puttest.a=1 ns:${NAMESPACEPREFIX}-2/$DIR.puttest.b=2 +' + test_expect_success 'kvs: namespace prefix works with dir' ' flux kvs dir ns:${NAMESPACEPREFIX}-1/. | sort >output && cat >expected <