]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix read of format_version out of leveldb
authorSage Weil <sage@inktank.com>
Wed, 12 Jun 2013 18:23:23 +0000 (11:23 -0700)
committerSage Weil <sage@inktank.com>
Thu, 13 Jun 2013 00:13:14 +0000 (17:13 -0700)
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>
src/mon/AuthMonitor.cc
src/mon/PaxosService.h

index 1d4158f9e9d9075cfa8992fc8bd62b2c0f069593..e4e0dacd8ba94a2a73af1174ee9a1abe7dc54783 100644 (file)
@@ -195,7 +195,7 @@ void AuthMonitor::update_from_paxos()
   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
index 2008dd6598ff429af3441979269c54c4a07e306d..a49e60a6fdc6c80444919492152b37f6f4522790 100644 (file)
@@ -966,6 +966,14 @@ public:
   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
    *