From: Samuel Just Date: Wed, 18 May 2011 17:40:33 +0000 (-0700) Subject: PG: prefer log with longer tail X-Git-Tag: v0.28.1~26^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b9797978c88313f4d38f7dbfe6bb57263b8c0b4;p=ceph.git PG: prefer log with longer tail Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cf3565d27495..54966cfdd7e5 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1342,7 +1342,9 @@ bool PG::choose_log_location(const PgPriorSet &prior_set, if (prior_set.cur.find(i->first) == prior_set.cur.end()) { continue; } - if (i->second.last_update > best_info->last_update) { + if (i->second.last_update > best_info->last_update || + ((i->second.last_update == best_info->last_update) && + (i->second.log_tail < best_info->log_tail))) { best_info = &(i->second); pull_from = i->first; newest_update = i->second.last_update;