This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1179,18 +1179,25 @@ impl Blockstore {
11791179
11801180 // Clear this slot as a next slot from parent
11811181 if let Some ( parent_slot) = slot_meta. parent_slot {
1182- let mut parent_slot_meta = self
1182+ if let Some ( mut parent_slot_meta) = self
11831183 . meta ( parent_slot)
11841184 . expect ( "Couldn't fetch from SlotMeta column family" )
1185- . expect ( "Unconfirmed slot should have had parent slot set" ) ;
1186- // .retain() is a linear scan; however, next_slots should
1187- // only contain several elements so this isn't so bad
1188- parent_slot_meta
1189- . next_slots
1190- . retain ( |& next_slot| next_slot != slot) ;
1191- self . meta_cf
1192- . put ( parent_slot, & parent_slot_meta)
1193- . expect ( "Couldn't insert into SlotMeta column family" ) ;
1185+ {
1186+ // .retain() is a linear scan; however, next_slots should
1187+ // only contain several elements so this isn't so bad
1188+ parent_slot_meta
1189+ . next_slots
1190+ . retain ( |& next_slot| next_slot != slot) ;
1191+ self . meta_cf
1192+ . put ( parent_slot, & parent_slot_meta)
1193+ . expect ( "Couldn't insert into SlotMeta column family" ) ;
1194+ } else {
1195+ error ! (
1196+ "Parent slot meta {} for child {} is missing or cleaned up.
1197+ Falling back to orphan repair to remedy the situation" ,
1198+ parent_slot, slot
1199+ ) ;
1200+ }
11941201 }
11951202 // Reinsert parts of `slot_meta` that are important to retain, like the `next_slots`
11961203 // field.
You can’t perform that action at this time.
0 commit comments