Skip to content

Commit

Permalink
osd/PeeringState: fix acting_set_writeable min_size check
Browse files Browse the repository at this point in the history
acting.size() >= pool.info.min_size is meant to check min_size against
acting set participants, but acting is a vector with placeholders.
actingset is the representation with placeholders removed.

The upshot of this bug is that the activation process will basically
ignore min_size for an ec pool allowing writes in cases where it
shouldn't.  PastIntervals::check_new_interval, however, performs
the check correctly, and will therefore discount intervals in which
we really did serve writes as not writeable.  This can trigger many
different problem conditions including but not limited to:
  - Unfound objects due to accepting a last_update with insufficient
    osds
  - Lost writes
  - Crashes due to peering rules being violated

This bug was originally introduced with recovery below min_size in
e5a96fd, and then preserved through refactors in 749a13d and 95bec9.

7cb818a exposed it with with expansion of recovery below min_size
to include ec pools (acting.size() is sufficient for replicated
pools).

Fixes: https://tracker.ceph.com/issues/48613
Fixes: https://tracker.ceph.com/issues/48417
Signed-off-by: Samuel Just <[email protected]>
  • Loading branch information
athanatos committed Apr 6, 2021
1 parent 7b2e0f4 commit 642a1c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/osd/PeeringState.h
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ class PeeringState : public MissingLoc::MappingInfo {
* applicable stretch cluster constraints.
*/
bool acting_set_writeable() {
return (acting.size() >= pool.info.min_size) &&
return (actingset.size() >= pool.info.min_size) &&
(pool.info.stretch_set_can_peer(acting, *get_osdmap(), NULL));
}

Expand Down

0 comments on commit 642a1c1

Please sign in to comment.