From b7d2f27da1a68046a688749f95093a88e6362b28 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 20 Oct 2017 17:34:49 -0700 Subject: [PATCH] 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 --- src/osd/PGBackend.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.39.5