Skip to content

Commit

Permalink
fixup! kvs: add date to kvs-primary checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chu11 committed Feb 17, 2022
1 parent 34cb08c commit ff905ed
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2761,37 +2761,39 @@ static int checkpoint_get (flux_t *h, const char *key,
key)))
return -1;
if (flux_rpc_get_unpack (f, "{s:s}", "value", &value) < 0)
goto error;
goto out;

/* if value is a blobref, its verison 0 checkpoint */
if (blobref_validate (value) == 0)
return checkpoint_get_version0 (h, value, buf, len);
if (blobref_validate (value) == 0) {
rv = checkpoint_get_version0 (h, value, buf, len);
goto out;
}

if (!(o = json_loads (value, 0, NULL))) {
errno = EINVAL;
goto error;
goto out;
}
if (json_is_object (o)) {
if (json_unpack (o, "{s:i}", "version", &version) < 0) {
errno = EINVAL;
goto error;
goto out;
}
/* only can handle version 1 right now */
if (version == 1) {
if (checkpoint_get_version1 (h, o, buf, len, timestamp) < 0)
goto error;
goto out;
}
else {
errno = EINVAL;
goto error;
goto out;
}
}
else {
errno = EINVAL;
goto error;
goto out;
}
rv = 0;
error:
out:
flux_future_destroy (f);
json_decref (o);
return rv;
Expand Down

0 comments on commit ff905ed

Please sign in to comment.