File tree 1 file changed +17
-10
lines changed
1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -1179,18 +1179,25 @@ impl Blockstore {
1179
1179
1180
1180
// Clear this slot as a next slot from parent
1181
1181
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
1183
1183
. meta ( parent_slot)
1184
1184
. 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
+ }
1194
1201
}
1195
1202
// Reinsert parts of `slot_meta` that are important to retain, like the `next_slots`
1196
1203
// field.
You can’t perform that action at this time.
0 commit comments