]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerNathan Cutler <ncutler@suse.com>
Sun, 28 Jan 2018 22:45:29 +0000 (23:45 +0100)
Caused by: cd0d8b0714d8684cf61b4650e170027ef46f489b

Fixes: http://tracker.ceph.com/issues/21907
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit b7d2f27da1a68046a688749f95093a88e6362b28)

src/osd/PGBackend.cc

index 468e29297d0de41e14bad096c23d4ee82d2219ed..389e953b1e28de2b82dc7d4efa06d2e728500138 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) {