Project

General

Profile

Actions

Bug #65371

closed
KS KS

rados: PeeringState::calc_replicated_acting_stretch populate acting set before checking if < bucket_max

Bug #65371: rados: PeeringState::calc_replicated_acting_stretch populate acting set before checking if < bucket_max

Added by Kamoltat (Junior) Sirivadhna over 2 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
High
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
squid, reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Fixed In:
v19.3.0-4089-gda6c7b0c7c
Released In:
v20.2.0~2275
Upkeep Timestamp:
2026-08-28T01:38:12+00:00

Description

I noticed that in the final stage of the func PeeringState::calc_replicated_acting_stretch we are populating the acting_set before checking whether the next OSD we are about to add into the acting set will exceed the bucket_max we imposed for the number of OSDs that shares the same ancestor. This leads to a scenario where we would have 3 OSDs from the same data center. Here is the evidence from a local test I ran where we enter the stretch pool and 2 DCs are down:

calc_replicated_acting_stretch
bucket_max: 2
 osd 8 primary accepted 15.6( v 971'2 (0'0,971'2] local-lis/les=982/983 n=0 ec=964/964 lis/c=982/969 les/c/f=983/971/0 sis=984)
 osd 8 (up) accepted 15.6( v 971'2 (0'0,971'2] local-lis/les=982/983 n=0 ec=964/964 lis/c=982/969 les/c/f=983/971/0 sis=984)
 osd 6 (up) accepted 15.6( v 971'2 (0'0,971'2] local-lis/les=982/983 n=0 ec=964/964 lis/c=982/969 les/c/f=983/971/0 sis=984)
want: [8,6]
acting: [8,6,7]
ancestors: {-9=candidates[<>]}
 up set insufficient, considering remaining osds
 acting candidate 7 15.6( v 971'2 (0'0,971'2] local-lis/les=982/983 n=0 ec=964/964 lis/c=982/969 les/c/f=983/971/0 sis=984)
 next: candidates[<0,971'2,7>]
pop_ancestor accepting candidate 7
want is now: [8,6,7]
acting_backfill is now: 6,7,8
 num_selected: 3

Now, we actually will get away with this because in:

 bool acting_set_writeable() {
   return (actingset.size() >= pool.info.min_size) &&
     (pool.info.stretch_set_can_peer(acting, *get_osdmap(), NULL));
 }

actingset.size() is definitely >= pool.info.min_size (assuming min_size=3)
We only go active if `stretch_set_can_peer` also returns True, which guess what … it will return False

Therefore, instead of this:


 while (!aheap.is_empty() && want->size() < pool.info.size) {
    auto next = aheap.pop();
    pop_ancestor(next.get());
    if (next.get().get_num_selected() < bucket_max) {
      aheap.push_if_nonempty(next);
    }
  }

we should do this:

  while (!aheap.is_empty() && want->size() < pool.info.size) {
    auto next = aheap.pop();
    if (next.get().get_num_selected() < bucket_max) {
      pop_ancestor(next.get());
      aheap.push_if_nonempty(next);
    }
  }

Related issues 2 (0 open — 2 closed)

Related to RADOS - Bug #64802: rados: generalize stretch mode pg temp handling to be usable without stretch modeResolvedKamoltat (Junior) Sirivadhna

Actions
Copied to RADOS - Backport #67411: squid: rados: PeeringState::calc_replicated_acting_stretch populate acting set before checking if < bucket_maxResolvedKamoltat (Junior) Sirivadhna

Actions

KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago Actions #1

  • Related to Bug #64802: rados: generalize stretch mode pg temp handling to be usable without stretch mode added

KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago Actions #2

  • Description updated (diff)

RZ Updated by Radoslaw Zarzynski over 2 years ago Actions #3

Bump up.

RZ Updated by Radoslaw Zarzynski over 2 years ago Actions #4

In review.

KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago Actions #5

  • Pull request ID changed from 56233 to 57381

LF Updated by Laura Flores over 2 years ago Actions #6

Note from bug scrub: In review.

KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago Actions #7

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot over 2 years ago Actions #8

  • Copied to Backport #67411: squid: rados: PeeringState::calc_replicated_acting_stretch populate acting set before checking if < bucket_max added

UB Updated by Upkeep Bot over 2 years ago Actions #9

  • Tags (freeform) set to backport_processed

KS Updated by Kamoltat (Junior) Sirivadhna about 2 years ago Actions #10

  • Status changed from Pending Backport to Resolved

All pending backports has been merged

UB Updated by Upkeep Bot over 1 year ago Actions #11

  • Merge Commit set to da6c7b0c7c1f7fcedcd66ee501820993ae506f8a
  • Fixed In set to v19.3.0-4089-gda6c7b0c7c1
  • Upkeep Timestamp set to 2025-07-11T13:47:06+00:00

UB Updated by Upkeep Bot over 1 year ago Actions #12

  • Fixed In changed from v19.3.0-4089-gda6c7b0c7c1 to v19.3.0-4089-gda6c7b0c7c
  • Upkeep Timestamp changed from 2025-07-11T13:47:06+00:00 to 2025-07-14T23:09:42+00:00

UB Updated by Upkeep Bot about 1 year ago Actions #13

  • Released In set to v20.2.0~2275
  • Upkeep Timestamp changed from 2025-07-14T23:09:42+00:00 to 2025-11-01T01:33:53+00:00

KS Updated by Kamoltat (Junior) Sirivadhna 10 months ago Actions #14

  • Backport changed from squid to squid, reef

UB Updated by Upkeep Bot 3 months ago Actions #15

  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2025-11-01T01:33:53+00:00 to 2026-08-28T01:38:12+00:00
Actions

Also available in: PDF Atom