Skip to content

Commit

Permalink
add info
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust committed Mar 19, 2024
1 parent 8967d7c commit 80cb484
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/es-node/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func createDataFile(cfg *storage.StorageConfig, shardIdxList []uint64, datadir s

df, err := es.Create(dataFile, startChunkId, chunkPerKv*cfg.KvEntriesPerShard, 0, cfg.KvSize, uint64(encodingType), cfg.Miner, cfg.ChunkSize)
if err != nil {
log.Error("Creating data file", "error", err)
log.Error("Creating data file", "file", dataFile, "error", err)
return nil, err
}
log.Info("Data file created", "shard", shardIdx, "file", dataFile, "kvIdxStart", df.KvIdxStart(), "kvIdxEnd", df.KvIdxEnd(), "miner", df.Miner())
Expand Down
7 changes: 4 additions & 3 deletions ethstorage/data_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ func Create(filename string, chunkIdxStart, chunkIdxLen, epoch, maxKvSize, encod

file, err := os.Create(filename)
if err != nil {
return nil, err
return nil, fmt.Errorf("create file error: " + err.Error())
}
offset := int64((chunkSize + 32) * chunkIdxLen)
// actual initialization is done when synchronize
err = fallocate.Fallocate(file, int64((chunkSize+32)*chunkIdxLen), int64(HEADER_SIZE))
err = fallocate.Fallocate(file, offset, int64(HEADER_SIZE))
if err != nil {
return nil, err
return nil, fmt.Errorf("fallocate failed. offset=%d, error=%s", offset, err.Error())
}
dataFile := &DataFile{
file: file,
Expand Down

0 comments on commit 80cb484

Please sign in to comment.