good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit a04fa483 authored by Alex Sharov's avatar Alex Sharov Committed by GitHub
Browse files

Snapshots: corner cases when .seg exists and .idx doesn't (#3731)

parent b73415fb
No related branches found
No related tags found
No related merge requests found
......@@ -600,12 +600,17 @@ func BuildIndices(ctx context.Context, s *RoSnapshots, snapshotDir *dir.Rw, chai
return err
}
if err := s.Txs.View(func(segments []*TxnSegment) error {
for i, sn := range segments {
if sn.From < from {
continue
}
return s.Bodies.View(func(bodySegments []*BodySegment) error {
for i, sn := range segments {
if sn.From < from {
continue
}
if bodySegments[i].idxBodyNumber == nil {
log.Info("[snapshots] Segment has no index, skip", "seg", bodySegments[i].seg.FilePath())
continue
}
if err := s.Bodies.View(func(bodySegments []*BodySegment) error {
// build txs idx
gg := bodySegments[i].seg.MakeGetter()
buf, _ := gg.Next(nil)
......@@ -633,13 +638,9 @@ func BuildIndices(ctx context.Context, s *RoSnapshots, snapshotDir *dir.Rw, chai
return err
}
return nil
}); err != nil {
return nil
}
}
return nil
return nil
})
}); err != nil {
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment