]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: prefer log with longer tail
authorSamuel Just <samuel.just@dreamhost.com>
Wed, 18 May 2011 17:40:33 +0000 (10:40 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 19 May 2011 00:04:17 +0000 (17:04 -0700)
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/PG.cc

index cf3565d274952b7b9bc30eb943a1ca462710f269..54966cfdd7e5b5f2b89bf90e8274f2da96d2a47b 100644 (file)
@@ -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;