]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Primary shard needs to be at the front to be preferred
authorDavid Zafman <dzafman@redhat.com>
Sat, 21 Oct 2017 00:34:49 +0000 (17:34 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 24 Oct 2017 20:32:14 +0000 (13:32 -0700)
Caused by: cd0d8b0714d8684cf61b4650e170027ef46f489b

Fixes: http://tracker.ceph.com/issues/21907
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PGBackend.cc

index 04121f4b88ec246cdd141317b20ad0a8918f067b..50119de7d05860ea1e7093456336896f3fe30640 100644 (file)
@@ -768,7 +768,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
   eversion_t auth_version;
   bufferlist first_bl;
 
-  // Create list of shards with primary last so it will be auth copy all
+  // Create list of shards with primary first so it will be auth copy all
   // other things being equal.
   list<pg_shard_t> shards;
   for (map<pg_shard_t, ScrubMap *>::const_iterator j = maps.begin();
@@ -778,7 +778,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
       continue;
     shards.push_back(j->first);
   }
-  shards.push_back(get_parent()->whoami_shard());
+  shards.push_front(get_parent()->whoami_shard());
 
   map<pg_shard_t, ScrubMap *>::const_iterator auth = maps.end();
   for (auto &l : shards) {