summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-30 22:48:52 -0700
committerSage Weil <sage@inktank.com>2013-05-01 11:05:02 -0700
commita21ea0186d9a7ef136ccadf96c02ba683bc5e533 (patch)
tree9c1e09df1c6ad0d3e4987076523470d14cc00bbe
parent88c030fc05dcc5227ec1b3e32e9169312d640ac1 (diff)
downloadceph-a21ea0186d9a7ef136ccadf96c02ba683bc5e533.tar.gz
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 <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/mon/PaxosService.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc
index 647980a9342..8f421ab3d81 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,