From 200e2964ea989a3f2b06b597ce03682bf522bcb7 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sun, 2 Mar 2014 13:42:16 -0800 Subject: [PATCH] PGLog::proc_replica_log: _merge_divergent_entries based on truncated olog We can't merge using the primary's log since we haven't decided whether to send them a complete log yet. Thus, merge based on the truncated olog rather than the primary's log. This is a consequence of the division between trimming divergent entries in peering/unfound search and sending a complete log to actual members of the actingbackfill set in activate(). _merge_divergent_entries on the truncated log and add_next_event() on the newer entries result in the same missing/log regardless of the order in which they are performed. Signed-off-by: Samuel Just --- src/osd/PGLog.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index e563b4e4c9957..beb2f0d905a12 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -183,6 +183,7 @@ void PGLog::proc_replica_log( // don't continue past the tail of our log. if (oe.version <= log.tail) { + ++pp; break; } @@ -192,24 +193,25 @@ void PGLog::proc_replica_log( dout(10) << " had " << oe << " new " << *(i->second) << " : match, stopping" << dendl; lu = pp->version; + ++pp; break; } divergent.push_front(oe); } - for (list::iterator i = divergent.begin(); - i != divergent.end(); - ++i) { - _merge_old_entry( - t, - *i, - oinfo, - omissing, - olog.can_rollback_to, - 0, - 0); - } + + IndexedLog folog; + folog.log.insert(folog.log.begin(), olog.log.begin(), pp); + folog.index(); + _merge_divergent_entries( + folog, + divergent, + oinfo, + olog.can_rollback_to, + omissing, + 0, + 0); if (lu < oinfo.last_update) { dout(10) << " peer osd." << from << " last_update now " << lu << dendl; -- 2.39.5