Bug #65371
closedrados: PeeringState::calc_replicated_acting_stretch populate acting set before checking if < bucket_max
0%
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);
}
}
KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago
- 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
- Description updated (diff)
RZ Updated by Radoslaw Zarzynski over 2 years ago
Bump up.
RZ Updated by Radoslaw Zarzynski over 2 years ago
In review.
KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago
- Pull request ID changed from 56233 to 57381
LF Updated by Laura Flores over 2 years ago
Note from bug scrub: In review.
KS Updated by Kamoltat (Junior) Sirivadhna over 2 years ago
- Status changed from Fix Under Review to Pending Backport
UB Updated by Upkeep Bot over 2 years ago
- 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
- Tags (freeform) set to backport_processed
KS Updated by Kamoltat (Junior) Sirivadhna about 2 years ago
- Status changed from Pending Backport to Resolved
All pending backports has been merged
UB Updated by Upkeep Bot over 1 year ago
- 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
- 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
- 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
- Backport changed from squid to squid, reef
Adding reef backport because: https://tracker.ceph.com/issues/73944
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2025-11-01T01:33:53+00:00 to 2026-08-28T01:38:12+00:00