From 62054fdb62813672b13d8f9210129d6b4e77add1 Mon Sep 17 00:00:00 2001 From: Henry Chang Date: Thu, 10 Mar 2011 09:44:22 -0800 Subject: [PATCH] osd: fix merge_log missing calculation at split point when logs diverge If primary log is something like 1'1 1'2 1'3 and remote log is 1'1 1'2 2'3 2'4 2'5 Then 1'2 is the split point, but we should advance p because it exists in both logs. Comparing to log.head is not a sufficient check for that. Signed-off-by: Henry Chang Signed-off-by: Sage Weil --- src/osd/PG.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index e634296046e10..332bd475b1e30 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -351,7 +351,9 @@ void PG::merge_log(ObjectStore::Transaction& t, if (p->version <= log.head) { dout(10) << "merge_log split point is " << *p << dendl; - if (p->version == log.head) + hash_map::const_iterator oldobj = old_objects.find(p->soid); + if (oldobj != old_objects.end() && + oldobj->second->version == p->version) p++; // move past the split point, if it also exists in our old log... break; } -- 2.39.5