If our map get_version check needs to be retried, tell the
is_latest_map() callers instead of giving returning 0 ("no").
Fixes: #3049
Signed-off-by: Sage Weil <sage@inktank.com>
version_t have;
C_IsLatestMap(Context *f, version_t h) : onfinish(f), have(h) {}
void finish(int r) {
- onfinish->complete(have != newest);
+ onfinish->complete(r == 0 ? (have != newest) : r);
}
};
// version requests
public:
+ /**
+ * check if we have the latest version of a map
+ *
+ * @param map name of map (e.g., 'osdmap')
+ * @param cur_ver version we have
+ * @param onfinish completion
+ * @return (via context) 1 if cur_ver is the latest, 0 if it is not, -EAGAIN if we need to retry
+ */
void is_latest_map(string map, version_t cur_ver, Context *onfinish);
/**