osd: do not double-write log entries

The pg_log.add() call already dirties the log such that the later
write_log() call will write it.  There is no need to encode it separately
here and then explicitly omap_setkeys() it.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-03-25 10:34:45 -07:00
parent 34c7d2c527
commit edf64dd564
2 changed files with 3 additions and 9 deletions

View File

@ -2893,7 +2893,7 @@ void PG::trim_peers()
}
}
void PG::add_log_entry(const pg_log_entry_t& e, bufferlist& log_bl)
void PG::add_log_entry(const pg_log_entry_t& e)
{
// raise last_complete only if we were previously up to date
if (info.last_complete == info.last_update)
@ -2911,8 +2911,6 @@ void PG::add_log_entry(const pg_log_entry_t& e, bufferlist& log_bl)
// log mutation
pg_log.add(e);
dout(10) << "add_log_entry " << e << dendl;
e.encode_with_checksum(log_bl);
}
@ -2936,11 +2934,10 @@ void PG::append_log(
}
dout(10) << "append_log " << pg_log.get_log() << " " << logv << dendl;
map<string,bufferlist> keys;
for (vector<pg_log_entry_t>::const_iterator p = logv.begin();
p != logv.end();
++p) {
add_log_entry(*p, keys[p->get_key_name()]);
add_log_entry(*p);
}
PGLogEntryHandler handler;
@ -2962,9 +2959,6 @@ void PG::append_log(
trim_rollback_to));
}
dout(10) << "append_log adding " << keys.size() << " keys" << dendl;
t.omap_setkeys(coll, pgmeta_oid, keys);
pg_log.trim(&handler, trim_to, info);
dout(10) << __func__ << ": trimming to " << trim_rollback_to

View File

@ -2126,7 +2126,7 @@ public:
return at_version;
}
void add_log_entry(const pg_log_entry_t& e, bufferlist& log_bl);
void add_log_entry(const pg_log_entry_t& e);
void append_log(
const vector<pg_log_entry_t>& logv,
eversion_t trim_to,