]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: Optimized EC choose_acting needs to use best primary shard
authorBill Scales <bill_scales@uk.ibm.com>
Mon, 4 Aug 2025 15:24:41 +0000 (16:24 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 22 Sep 2025 09:48:09 +0000 (09:48 +0000)
commita1917ec42e5d17a665fc51a9eb5bf656d6ef59e8
tree0a56a9112a69614aa7c590a09cc06d056753c604
parentd847bc66d8e2dce96c83410b9c47b33b08aad474
osd: Optimized EC choose_acting needs to use best primary shard

There have been a couple of corner case bugs with choose_acting
with optimized EC pools in the scenario where a new primary
with no existing log is choosen and find_best_info selects
a non-primary shard as the authorative shard.

Non-primary shards don't have a full log so in this scenario
we need to get the log from a shard that does have a complete
log first (so our log is ahead or eqivalent to authorative shard)
and then repeat the get log for the authorative shard.

Problems arise if we make different decisions about the acting
set and backfill/recovery based on these two different shards.
In one bug we osicillated between two different primaries
because one primary used one shard to making peering decisions
and the other primary used the other shard, resulting in
looping flip/flop changes to the acting_set.

In another bug we used one shard to decide that we could do
async recovery but then tried to get the log from another
shard and asserted because we didn't have enough history in
the log to do recovery and should have choosen to do a backfill.

This change makes optimized EC pools always choose the
best !non_primary shard when making decisions about peering
(irrespective of whether the primary has a full log or not).
The best overall shard is now only used for get log when
deciding how far to rollback the log.

It also sets repeat_getlog to false if peering fails because
the PG is incomplete to avoid looping forever trying to get
the log.

Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
(cherry picked from commit f3f45c2ef3e3dd7c7f556b286be21bd5a7620ef7)
(cherry picked from commit 30c287090344279eec5badaf7f545e1b4cdd00ef)
src/osd/PeeringState.cc
src/osd/PeeringState.h