From: David Zafman Date: Sat, 21 Oct 2017 00:34:49 +0000 (-0700) Subject: osd: Primary shard needs to be at the front to be preferred X-Git-Tag: v12.2.3~115^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c2a8f1dd08882eca83512152c8570f497081229;p=ceph.git osd: Primary shard needs to be at the front to be preferred Caused by: cd0d8b0714d8684cf61b4650e170027ef46f489b Fixes: http://tracker.ceph.com/issues/21907 Signed-off-by: David Zafman (cherry picked from commit b7d2f27da1a68046a688749f95093a88e6362b28) --- diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 468e29297d0d..389e953b1e28 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -768,7 +768,7 @@ map::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 shards; for (map::const_iterator j = maps.begin(); @@ -778,7 +778,7 @@ map::const_iterator continue; shards.push_back(j->first); } - shards.push_back(get_parent()->whoami_shard()); + shards.push_front(get_parent()->whoami_shard()); map::const_iterator auth = maps.end(); for (auto &l : shards) {