Skip to content

Commit

Permalink
kvs: add root_seq to kvstxn_process()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chu11 authored and mergify[bot] committed Aug 8, 2022
1 parent 402b5b8 commit db0d5ba
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 85 deletions.
4 changes: 3 additions & 1 deletion src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion src/modules/kvs/kvstxn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/modules/kvs/kvstxn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit db0d5ba

Please sign in to comment.