From ff905ed18ca6dc696d80e2383f9b80075b90aa0d Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Wed, 16 Feb 2022 22:28:30 -0800 Subject: [PATCH] fixup! kvs: add date to kvs-primary checkpoint --- src/modules/kvs/kvs.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index 73cd256a101f..da2841891ad1 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -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;