diff --git a/compress/decompress.go b/compress/decompress.go index cc89e4c50..a20b2b0ad 100644 --- a/compress/decompress.go +++ b/compress/decompress.go @@ -21,6 +21,7 @@ import ( "encoding/binary" "fmt" "os" + "path/filepath" "strconv" "github.com/ledgerwatch/erigon-lib/common/dbg" @@ -372,6 +373,10 @@ func (d *Decompressor) Close() error { } func (d *Decompressor) FilePath() string { return d.compressedFile } +func (d *Decompressor) FileName() string { + _, fName := filepath.Split(d.compressedFile) + return fName +} // WithReadAhead - Expect read in sequential order. (Hence, pages in the given range can be aggressively read ahead, and may be freed soon after they are accessed.) func (d *Decompressor) WithReadAhead(f func() error) error { diff --git a/recsplit/index.go b/recsplit/index.go index 0cd92a14c..89f599fd2 100644 --- a/recsplit/index.go +++ b/recsplit/index.go @@ -147,11 +147,13 @@ func OpenIndex(indexFile string) (*Index, error) { return idx, nil } -func (idx *Index) Size() int64 { - return idx.size -} - +func (idx *Index) Size() int64 { return idx.size } func (idx *Index) BaseDataID() uint64 { return idx.baseDataID } +func (idx *Index) FilePath() string { return idx.indexFile } +func (idx *Index) FileName() string { + _, fName := filepath.Split(idx.indexFile) + return fName +} func (idx *Index) Close() error { if idx == nil { diff --git a/state/aggregator22.go b/state/aggregator22.go index 78921cac2..6fdacd747 100644 --- a/state/aggregator22.go +++ b/state/aggregator22.go @@ -425,7 +425,6 @@ func (a *Aggregator22) buildFilesInBackground(ctx context.Context, step uint64, } }() a.integrateFiles(sf, step*a.aggregationStep, (step+1)*a.aggregationStep) - log.Info("[snapshots] history build done", "step", fmt.Sprintf("%d-%d", step, step+1)) closeAll = false return nil diff --git a/state/merge.go b/state/merge.go index edd21b6fd..ba2320414 100644 --- a/state/merge.go +++ b/state/merge.go @@ -24,6 +24,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/ledgerwatch/log/v3" @@ -270,7 +271,16 @@ func (h *History) staticFilesInRange(r HistoryRanges) (indexFiles, historyFiles } } if r.index && len(indexFiles) != len(historyFiles) { - log.Warn("something wrong with files for merge", "idx", fmt.Sprintf("%+v", indexFiles), "hist", fmt.Sprintf("%+v", historyFiles)) + var sIdx, sHist []string + for _, f := range indexFiles { + _, fName := filepath.Split(f.index.FilePath()) + sIdx = append(sIdx, fmt.Sprintf("%+v", fName)) + } + for _, f := range historyFiles { + _, fName := filepath.Split(f.decompressor.FilePath()) + sHist = append(sHist, fmt.Sprintf("%+v", fName)) + } + log.Warn("something wrong with files for merge", "idx", strings.Join(sIdx, ","), "hist", strings.Join(sHist, ",")) } } return