summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-09-15 21:00:55 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-09-16 00:32:59 +0100
commit4ac1570c5cdcd6556dc291cc6d7878fd92d343ae (patch)
tree1c70b04a4d2ce2edb3d9eb0c3011290d6f1f2839
parent4216eac0f59af60f60d4ce909b9ace87a7b64ccc (diff)
downloadceph-4ac1570c5cdcd6556dc291cc6d7878fd92d343ae.tar.gz
mon: OSDMonitor: smaller transactions when rebuilding full versions
Otherwise, for considerably sized rebuilds, the monitor will not only consume vast amounts of memory, but it will also have troubles committing the transaction. Anyway, it's also a good idea to adjust transactions to the granularity we want, and to be fair we care that each rebuilt full map gets to disk, even if subsequent full maps don't (those can be rebuilt later). Fixes: #6323 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 85dcf576271..3f45a18111a 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -179,13 +179,13 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
}
// walk through incrementals
- MonitorDBStore::Transaction t;
while (version > osdmap.epoch) {
+ MonitorDBStore::Transaction t;
bufferlist inc_bl;
int err = get_version(osdmap.epoch+1, inc_bl);
assert(err == 0);
assert(inc_bl.length());
-
+
dout(7) << "update_from_paxos applying incremental " << osdmap.epoch+1 << dendl;
OSDMap::Incremental inc(inc_bl);
err = osdmap.apply_incremental(inc);
@@ -202,9 +202,9 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
if (osdmap.epoch == 1) {
t.erase("mkfs", "osdmap");
}
+ if (!t.empty())
+ mon->store->apply_transaction(t);
}
- if (!t.empty())
- mon->store->apply_transaction(t);
for (int o = 0; o < osdmap.get_max_osd(); o++) {
if (osdmap.is_down(o)) {