diff --git a/state/history.go b/state/history.go index 52537f741..4f14d01c9 100644 --- a/state/history.go +++ b/state/history.go @@ -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 diff --git a/state/inverted_index.go b/state/inverted_index.go index f4485446f..6bf81a43a 100644 --- a/state/inverted_index.go +++ b/state/inverted_index.go @@ -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