Project

General

Profile

Actions

Bug #79706

closed
BS BS

osd/PeeringState: fix proc_master_log divergence check vs olog.head

Bug #79706: osd/PeeringState: fix proc_master_log divergence check vs olog.head

Added by Bill Scales 3 months ago. Updated 2 months ago.

Status:
Backporting
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle,umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-3870-g375511523e
Released In:
Upkeep Timestamp:
2026-09-30T20:28:25+00:00

Description

The FastEC changes introduced in tentacle have a bug in proc_master_log which merges the definitive log into the primary's log during peering where it creates an iterator that points to the end sentinel of olog and then de-references it which is not allowed. The code was meant to be looking at the last entry in olog.

This bug only affects FastEC. It is very rare for olog not to be empty because EC chooses the definitive log as the the shard which is furthest behind, and normally GetLog::GetLog only requests log entries that are ahead of the Primary - which will result in olog being empty. There is however an exception in GetLog::GetLog when there is a backfilling shard and the definitive log has entries which could be used to perform recovery instead of a backfill.

@@ -3467,25 +3467,28 @@ void PeeringState::proc_master_log(
       // of p->version. So long as there are no entries in olog between
       // p->version and olog.head we can still try to wind forward
       // partially written entries
       auto op = olog.log.end();                     <<< NOTE op iterator initialized to end sentinel
       if (op == olog.log.begin()) {                 <<< THIS IS THE NORMAL PATH
         // Other log is emtpy
         if (p->version <= olog.head) {
           consider_adjusting_pwlc(p->version);
           ++p;
         } else {
           consider_adjusting_pwlc(pg_log.get_tail());
         }
       } else if (op->version == p->version) {       <<< BUG
         // Normal case - both logs have this entry
         consider_adjusting_pwlc(p->version);
         ++p;
       } else if (op->version < p->version) {        <<< BUG
         // Last entry in other log is before this entry
         consider_adjusting_pwlc(pg_log.get_tail());
       } else {
         // Other log is ahead of the primary log - give up
         p = pg_log.get_log().log.end();
       }

Related issues 3 (2 open — 1 closed)

Has duplicate RADOS - Bug #80359: Undefined end() iterator in proc_master_log can cause pwlc values to be set incorrectlyDuplicateJonathan Bailey

Actions
Copied to RADOS - Backport #81227: umbrella: osd/PeeringState: fix proc_master_log divergence check vs olog.headNewBill Scales

Actions
Copied to RADOS - Backport #81228: tentacle: osd/PeeringState: fix proc_master_log divergence check vs olog.headNewBill Scales

Actions

BS Updated by Bill Scales 3 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Pull request ID set to 70149

KS Updated by Kamoltat (Junior) Sirivadhna 3 months ago Actions #2

needs testing

LF Updated by Laura Flores 3 months ago Actions #3

  • Backport changed from tentacle umbrella to tentacle,umbrella

Bill has written that he is planning to push some unit tests to the PR.

LF Updated by Laura Flores 3 months ago ยท Edited Actions #4

Scrub note: Status is still the same.

KS Updated by Kamoltat (Junior) Sirivadhna 3 months ago Actions #5

scrub: still waiting for the same status

LF Updated by Laura Flores 2 months ago Actions #6

Same

LF Updated by Laura Flores 2 months ago Actions #7

  • Has duplicate Bug #80359: Undefined end() iterator in proc_master_log can cause pwlc values to be set incorrectly added

BS Updated by Bill Scales 2 months ago Actions #8

2nd commit added with unit tests. Ready for QA testing

VG Updated by Vitaly Goot 2 months ago Actions #9

We hit this on v20.2.4 (8+3, allow_ec_optimizations) in a full-cluster restart test, in a PG that had a backfilling shard, which is the exception described above. With a non-empty olog, proc_master_log() called consider_adjusting_pwlc(pg_log.get_tail()) and rolled the pwlc of shards 1-7 back to the primary's log tail. The replicas' logs looked identical, so activate() sent them only the info, and five replicas asserted at the same moment:

PeeringState.cc: 7334: FAILED ceph_assert(ps->info.last_update >= pwlc.first)

Partial writes had skipped those shards for longer than the log, so their own last_update was older than the tail. As far as we can tell from the code, the logic in #70149 would roll forward here instead. When data shards go unwritten for a long time, the result is several OSDs down at once, so this may deserve more than minor severity. We have the primary's debug_osd 10 log for that peering if it helps.

Related: #81183, a separate peering bug in the same area, found in the same tests.

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

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot 2 months ago Actions #11

  • Copied to Backport #81227: umbrella: osd/PeeringState: fix proc_master_log divergence check vs olog.head added

UB Updated by Upkeep Bot 2 months ago Actions #12

  • Copied to Backport #81228: tentacle: osd/PeeringState: fix proc_master_log divergence check vs olog.head added

UB Updated by Upkeep Bot 2 months ago Actions #13

  • Status changed from Pending Backport to Backporting
  • Merge Commit set to 375511523ed523b6bb434806c85b97283d0704f0
  • Fixed In set to v21.3.0-3870-g375511523e
  • Upkeep Timestamp set to 2026-09-30T20:28:25+00:00
Actions

Also available in: PDF Atom