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: v13.0.1~384^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b7d2f27da1a68046a688749f95093a88e6362b28;p=ceph-ci.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 --- diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 04121f4b88e..50119de7d05 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) {