From: Sage Weil Date: Wed, 1 May 2013 05:48:52 +0000 (-0700) Subject: Revert "PaxosService: use get and put for version_t" X-Git-Tag: v0.61~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a21ea0186d9a7ef136ccadf96c02ba683bc5e533;p=ceph.git Revert "PaxosService: use get and put for version_t" This reverts commit e725c3e210b244e090d70c77d937c94f4f63a2be. These inadvertantely got rid of the prefix portion of the key, which lead to overwriting the wrong keys. Fixes: #4872 Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 647980a9342c..8f421ab3d818 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -294,13 +294,19 @@ void PaxosService::put_version(MonitorDBStore::Transaction *t, const string& prefix, version_t ver, bufferlist& bl) { - t->put(get_service_name(), ver, bl); + ostringstream os; + os << ver; + string key = mon->store->combine_strings(prefix, os.str()); + t->put(get_service_name(), key, bl); } int PaxosService::get_version(const string& prefix, version_t ver, bufferlist& bl) { - return mon->store->get(get_service_name(), ver, bl); + ostringstream os; + os << ver; + string key = mon->store->combine_strings(prefix, os.str()); + return mon->store->get(get_service_name(), key, bl); } void PaxosService::trim(MonitorDBStore::Transaction *t,