mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
save
This commit is contained in:
parent
183856e788
commit
00bb99d66d
@ -182,6 +182,7 @@ func (h *History) scanStateFiles(files []fs.DirEntry) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
log.Info("scan files", "name", fmt.Sprintf("%s.%d-%d.v", h.filenameBase, startStep, endStep))
|
||||
h.files.ReplaceOrInsert(item)
|
||||
}
|
||||
if len(uselessFiles) > 0 {
|
||||
@ -201,10 +202,12 @@ func (h *History) openFiles() error {
|
||||
fromStep, toStep := item.startTxNum/h.aggregationStep, item.endTxNum/h.aggregationStep
|
||||
datPath := filepath.Join(h.dir, fmt.Sprintf("%s.%d-%d.v", h.filenameBase, fromStep, toStep))
|
||||
if !dir.FileExist(datPath) {
|
||||
log.Warn("open files: not exists!", "name", fmt.Sprintf("%s.%d-%d.v", h.filenameBase, fromStep, toStep))
|
||||
invalidFileItems = append(invalidFileItems, item)
|
||||
return true
|
||||
}
|
||||
if item.decompressor, err = compress.NewDecompressor(datPath); err != nil {
|
||||
log.Warn("open files: NewDecompressor!", "err", err, "name", fmt.Sprintf("%s.%d-%d.v", h.filenameBase, fromStep, toStep))
|
||||
log.Debug("Hisrory.openFiles: %w, %s", err, datPath)
|
||||
return false
|
||||
}
|
||||
@ -212,10 +215,13 @@ func (h *History) openFiles() error {
|
||||
idxPath := filepath.Join(h.dir, fmt.Sprintf("%s.%d-%d.vi", h.filenameBase, fromStep, toStep))
|
||||
if dir.FileExist(idxPath) {
|
||||
if item.index, err = recsplit.OpenIndex(idxPath); err != nil {
|
||||
log.Warn("open files: recsplit.OpenIndex!", "err", err, "name", fmt.Sprintf("%s.%d-%d.v", h.filenameBase, fromStep, toStep))
|
||||
log.Debug("Hisrory.openFiles: %w, %s", err, idxPath)
|
||||
return false
|
||||
}
|
||||
totalKeys += item.index.KeyCount()
|
||||
} else {
|
||||
log.Warn("open files: not exists!", "err", fmt.Sprintf("%s.%d-%d.vi", h.filenameBase, fromStep, toStep))
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
@ -246,9 +246,11 @@ func (ii *InvertedIndex) openFiles() error {
|
||||
fromStep, toStep := item.startTxNum/ii.aggregationStep, item.endTxNum/ii.aggregationStep
|
||||
datPath := filepath.Join(ii.dir, fmt.Sprintf("%s.%d-%d.ef", ii.filenameBase, fromStep, toStep))
|
||||
if !dir.FileExist(datPath) {
|
||||
log.Warn("open files: not exists!", "name", fmt.Sprintf("%s.%d-%d.ef", ii.filenameBase, fromStep, toStep))
|
||||
invalidFileItems = append(invalidFileItems, item)
|
||||
}
|
||||
if item.decompressor, err = compress.NewDecompressor(datPath); err != nil {
|
||||
log.Warn("open files: compress.NewDecompressor!", "err", err, "name", fmt.Sprintf("%s.%d-%d.ef", ii.filenameBase, fromStep, toStep))
|
||||
log.Debug("InvertedIndex.openFiles: %w, %s", err, datPath)
|
||||
return false
|
||||
}
|
||||
@ -257,10 +259,13 @@ func (ii *InvertedIndex) openFiles() error {
|
||||
idxPath := filepath.Join(ii.dir, fmt.Sprintf("%s.%d-%d.efi", ii.filenameBase, fromStep, toStep))
|
||||
if dir.FileExist(idxPath) {
|
||||
if item.index, err = recsplit.OpenIndex(idxPath); err != nil {
|
||||
log.Debug("InvertedIndex.openFiles: %w, %s", err, idxPath)
|
||||
log.Warn("open files: recsplit.OpenIndex!", "err", err, "name", fmt.Sprintf("%s.%d-%d.efi", ii.filenameBase, fromStep, toStep))
|
||||
log.Info("open files: not exists!", "name", fmt.Sprintf("%s.%d-%d.efi", ii.filenameBase, fromStep, toStep))
|
||||
return false
|
||||
}
|
||||
totalKeys += item.index.KeyCount()
|
||||
} else {
|
||||
log.Warn("open files: not exists!", "name", fmt.Sprintf("%s.%d-%d.efi", ii.filenameBase, fromStep, toStep))
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user