The get_version(string, string) is the wrong method; it combines the two
args into a key that is nested inside prefix (so it's prefix/a/b), but we
want perfix/format_version. Add a method to grab an int for this
particular combo and use that.
This fixes an infinite loop when we actually trigger this code.
Bug introduced by
f43c974571beac0c8e54fa699bfa96a1befaf56c.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
if (last_allocated_id == 0)
last_allocated_id = max_global_id;
- format_version = get_version(get_service_name(), "format_version");
+ format_version = get_value("format_version");
dout(10) << "update_from_paxos() last_allocated_id=" << last_allocated_id
<< " max_global_id=" << max_global_id
int get_value(const string& key, bufferlist& bl) {
return mon->store->get(get_service_name(), key, bl);
}
+ /**
+ * Get an integer value from a given key.
+ *
+ * @param[in] key The key
+ */
+ int get_value(const string& key) {
+ return mon->store->get(get_service_name(), key);
+ }
/**
* Get the contents of our mkfs entry
*