Bug #75962
closedOSD crashes with FAILED ceph_assert(0 == "unexpected need for missing item") in MissingLoc::add_active_missing() during EC thrash
0%
Description
Run: https://pulpito.ceph.com/yuriw-2026-04-10_16:40:47-rados-main_base_4.10.26-distro-default-trial/
Jobs: 143655
Logs: https://pulpito.ceph.com/yuriw-2026-04-10_16:40:47-rados-main_base_4.10.26-distro-default-trial/143655/
Test: rados/thrash-erasure-code-isa with ISA k=10 m=4, OSD thrashing active with remapped/degraded shards (NONE positions in acting set) at time of crash.
From teuthology.log (tasks.ceph.osd.10.trial137.stderr):
./src/osd/MissingLoc.h: 242: FAILED ceph_assert(0 == "unexpected need for missing item") 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x125) [0x564982fe23b9] 2: ceph-osd(+0x408079) [0x564982f95079] 3: (PeeringState::activate(ceph::os::Transaction&, unsigned int, PeeringCtxWrapper&)+0x2029) [0x56498344cca9] 4: (PeeringState::Active::Active(...)+0x274) [0x564983466d14] 5: ceph-osd(+0x914ad3) [0x5649834a1ad3] 6: ceph-osd(+0x69b7e9) [0x5649832287e9] ceph version 21.0.0-392-g928bfc61 (928bfc6137f62a852de1aa7d1d32a591f89e6605) umbrella (dev)
Multiple OSDs on trial048, trial137 and trial166 crash simultaneously with the same assert during EC pool peering. The OSD holds a newer version (337'143) of an object but add_active_missing() attempts to register it at an older version (327'141):
3.3ds0 unexpected need for 3:bf430f91:::trial16616350-13:head have 337'143 flags = none clean_offsets: [], clean_omap: false, new_object: true tried to add 327'141 flags = none clean_offsets: [], clean_omap: false, new_object: true
YW Updated by Yuri Weinstein 8 months ago
- Source set to Q/A
YW Updated by Yuri Weinstein 8 months ago
- Description updated (diff)
YW Updated by Yuri Weinstein 8 months ago
https://github.com/ceph/ceph/pull/68284 Josh suggested that can be a fix
YW Updated by Yuri Weinstein 8 months ago
- Related to Bug #75778: osd/osd_types.h: 5250: FAILED ceph_assert(it->second == oid) added
AA Updated by Alex Ainscow 8 months ago
Not convinced this is a duplicate of 75778. I will have a more detailed look on Monday.
AA Updated by Alex Ainscow 8 months ago
This is the scenario described in #73249:
1. Shards in recovery/backfill: Multiple shards have `last_complete=298'133` but need to be at `327'141` - they have a gap of ~29 versions
2. Non-empty missing lists: The log shows `missing(11 may_include_deletes = 1)`
3. Partial writes: Version `337'143` was a partial write (only affected some shards) that occurred during recovery
4. PWLC attempted but failed: The logs show "cannot apply pwlc" for multiple shards
5. Missing list not updated: When the divergent version `337'143` was rolled back, the missing list wasn't properly updated to reflect that some shards still need the newer version while others need the older version
AA Updated by Alex Ainscow 8 months ago
- Related to Bug #73249: osd/MissingLoc.h: FAILED ceph_assert(0 == "unexpected need for missing item") added
AA Updated by Alex Ainscow 8 months ago
- Related to deleted (Bug #75778: osd/osd_types.h: 5250: FAILED ceph_assert(it->second == oid))
RZ Updated by Radoslaw Zarzynski 8 months ago · Edited
Hi Alex, just related-to to 73249 or duplicate?
LF Updated by Laura Flores 7 months ago
Bump up @Alex Ainscow
AA Updated by Alex Ainscow 7 months ago
I will have a discussion about whether we are going to fix #73249
BS Updated by Bill Scales 7 months ago
- Assignee set to Bill Scales
BS Updated by Bill Scales 7 months ago
I think the problem here is a rewind of a divergent log entry not updating the missing version need correctly:
Scenario:
With up set/acting set like this in epoch 337 [10,13,5,15,2,12,14,NONE,4,NONE,7,3,6,11]/[10,13,5,15,2,12,14,1,NONE,1,7,3,6,11]p10(0) async=[4(8)] pg 3.3d starts two writes neither of which completes before the next epoch and peering interval:
oid=3:bf430f91:::trial16616350-13:75 version=337'142 written={} shard_versions={}
oid=3:bf430f91:::trial16616350-13:head version=337'143 written={0,10,11,12,13} shard_versions={1=327'140,2=327'140,3=327'140,4=327'140,5=327'140,6=327'140,7=327'140,8=327'140,9=327'140}
OSD 4(8) is in async recovery, so completes both these log entries even though the write hasn't completed yet
The next peering cycle (epoch 340) correctly decides to rollback to 327'141 and activates in epoch 341
OSD 4(8) gets sent MInfo (no need to provide any log) telling it to rollback to 327'141
Here is its log for this (osd 4 log 2026-04-10T19:06:19.887+0000 7f8b1b146640)
state<Started/Stray>: got info from osd.10(0) 3.3ds0( v 327'141 lc 87'25 (0'0,327'141] local-lis/les=340/341 n=4 ec=300/33 lis/c=334/189 les/c/f=336/204/0 sis=340)
rewind_divergent_log truncate divergent future 327'141
rewind_divergent_log original_crt = 337'143
rewind_divergent_log future divergent 337'142 (327'141) clone 3:bf430f91:::trial16616350-13:75 by unknown.0.0:0 2026-04-10T19:06:04.015889+0000 0 snaps [74] ObjectCleanRegions clean_offsets: [0~18446744073709551615], clean_omap>
rewind_divergent_log future divergent 337'143 (327'141) modify 3:bf430f91:::trial16616350-13:head by client.4839.0:2584 2026-04-10T19:06:15.621478+0000 0 ObjectCleanRegions clean_offsets: [0~18446744073709551615], clean_omap: tr>
_merge_object_divergent_entries: merging hoid 3:bf430f91:::trial16616350-13:75 entries: 337'142 (327'141) clone 3:bf430f91:::trial16616350-13:75 by unknown.0.0:0 2026-04-10T19:06:04.015889+0000 0 snaps [74] ObjectCleanRegions c>
_merge_object_divergent_entries: keeping 337'142 (327'141) clone 3:bf430f91:::trial16616350-13:75 by unknown.0.0:0 2026-04-10T19:06:04.015889+0000 0 snaps [74] ObjectCleanRegions clean_offsets: [0~18446744073709551615], clean_o>
_merge_object_divergent_entries: hoid object_not_in_store: 0
_merge_object_divergent_entries: hoid 3:bf430f91:::trial16616350-13:75 prior_version: 327'141 first_divergent_update: 337'142 last_divergent_update: 337'142
_merge_object_divergent_entries: hoid 3:bf430f91:::trial16616350-13:75 has no more recent entries in log
_merge_object_divergent_entries: hoid 3:bf430f91:::trial16616350-13:75 prior_version or op type indicates creation, deleting
snap_mapper [pg_id:3d, match:61, mask_bits:6, last_key_checked:, pool:3, shard:8, shard_prefix: .8_, prefixes: {".8_0000000000000003.D3", ".8_0000000000000003.D7", ".8_0000000000000003.DB", ".8_0000000000000003.DF"}] remove_oid 3>
snap_mapper [pg_id:3d, match:61, mask_bits:6, last_key_checked:, pool:3, shard:8, shard_prefix: .8_, prefixes: {".8_0000000000000003.D3", ".8_0000000000000003.D7", ".8_0000000000000003.DB", ".8_0000000000000003.DF"}] _remove_oid >
snap_mapper get_snaps_common: key string: {"OBJ_.8_0000000000000003.DF2C0F98.75.trial16616350-13.."} oid:3:bf430f91:::trial16616350-13:75
bluestore(/var/lib/ceph/osd/ceph-4) omap_get_values meta oid #-1:c0371625:::snapmapper:0#
bluestore.onode(0x55cb2b796600).flush flush done
bluestore(/var/lib/ceph/osd/ceph-4) omap_get_values meta oid #-1:c0371625:::snapmapper:0# = 0
maybe_unpin 0x55cb2a43e000 #-1:c0371625:::snapmapper:0# touched
snap_mapper get_snaps_common 3:bf430f91:::trial16616350-13:75 got.empty()
_merge_object_divergent_entries: merging hoid 3:bf430f91:::trial16616350-13:head entries: 337'143 (327'141) modify 3:bf430f91:::trial16616350-13:head by client.4839.0:2584 2026-04-10T19:06:15.621478+0000 0 ObjectCleanRegions cle>
_merge_object_divergent_entries: ignoring partial write 337'143 (327'141) modify 3:bf430f91:::trial16616350-13:head by client.4839.0:2584 2026-04-10T19:06:15.621478+0000 0 ObjectCleanRegions clean_offsets: [0~1844674407370955161>
_merge_object_divergent_entries: no non-ERROR entries
The problem is that the partial write was ignored when the log entry was rolled backwards but it updated the missing version when the write was applied. This means OSD 4 ends up keeping a missing need of 337'143 even though this write has been rolled backwards.
In the next peering cycle OSD 10 (primary) asks OSD 4(8) for its missing list and gets upset that it has a different missing need than everyone else
There have been recent fixes to this function, need to look and see whether they will change the outcome
KS Updated by Kamoltat (Junior) Sirivadhna 7 months ago · Edited
- Status changed from New to In Progress
from bug-scrub: @Bill Scales why wouldn't the fix for https://tracker.ceph.com/issues/73249 also applies to this?
LF Updated by Laura Flores 7 months ago
Bump up
BS Updated by Bill Scales 7 months ago
- Status changed from In Progress to Fix Under Review
- Assignee changed from Bill Scales to Alex Ainscow
- Pull request ID set to 68727
Issue 73249 hits the same assert but is caused by a different problem. This assert is fairly generic - it means that two OSDs disagree about which version of an object is missing. Given that all the OSDs are meant to have the same log they are meant to come to the same conclusion about what version of the object is missing.
The bug that this issue is addressing is when processing divergent log entries - in this case the OSDs know they are out of sync and are trying to rollback log entries to get in sync. When a log entry is rolled backwards we mark the object as missing, but are miscalculating which version of the object is required resulting in a disagreement about which version is required.
Issue 73249 concerns a different problem where an OSD is being brought up to date with partial writes that did not modify the shard. The code is correctly deducing that the fact the OSD didn't see the partial writes is not a problem as nothing was modified, but is not dealing with the case that the partial write was to a missing object and should have updated the needed version. This results in two OSDs saying the same object is missing but needing a different version that then later hits this same assert.
LF Updated by Laura Flores 7 months ago
UB Updated by Upkeep Bot 6 months ago
- Status changed from Fix Under Review to Resolved
- Merge Commit set to a502b26a8f4f1ba951e4928e76944f2487a047bc
- Fixed In set to v21.0.0-1793-ga502b26a8f
- Upkeep Timestamp set to 2026-05-27T15:28:31+00:00
LF Updated by Laura Flores 6 months ago
- Status changed from Resolved to Fix Under Review
Main PR was merged; is a backport needed?
@Alex Ainscow @Bill Scales Main PR was merged; is a backport needed?
UB Updated by Upkeep Bot 6 months ago
- Status changed from Fix Under Review to Resolved
- Upkeep Timestamp changed from 2026-05-27T15:28:31+00:00 to 2026-05-28T01:24:48+00:00
BS Updated by Bill Scales 6 months ago
- Status changed from Resolved to Pending Backport
- Backport set to tentacle
Yes, lets backport this to tentacle - but its not urgent and it will be good to get more test time of this fix on main to make sure there aren't any further bugs in this area before we do the backport.
UB Updated by Upkeep Bot 6 months ago
- Copied to Backport #77099: tentacle: OSD crashes with FAILED ceph_assert(0 == "unexpected need for missing item") in MissingLoc::add_active_missing() during EC thrash added
UB Updated by Upkeep Bot 6 months ago
- Tags (freeform) set to backport_processed
KS Updated by Kamoltat (Junior) Sirivadhna 4 months ago
- Has duplicate Bug #78779: Dead: rados/thrash-erasure-code-isa : Dead Teuthology job due to repeated OSError: Socket is closed errors added
NM Updated by Nitzan Mordechai 4 months ago
@Alex Ainscow can you please check /a/skanta-2026-08-10_11:36:04-rados-wip-bharath1-testing-20260810.014116-main-distro-default-trial/452044
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Resolved
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-05-28T01:24:48+00:00 to 2026-08-27T18:32:51+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~357
- Upkeep Timestamp changed from 2026-08-27T18:32:51+00:00 to 2026-10-24T01:49:54+00:00
LS Updated by Lee Sanders 22 days ago
/a/yuriw-2026-10-30_15:01:41-rados-wip-yuri16-testing-20261026.172747-main-distro-default-trial/695404
Seen again after its fix: Bob's verdict from before, read from the cache