From ad866187e20d335e4cef2c08424b37b1773bfbfe Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Mon, 7 Feb 2022 18:33:45 +0700 Subject: [PATCH] save --- turbo/snapshotsync/block_snapshots.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/turbo/snapshotsync/block_snapshots.go b/turbo/snapshotsync/block_snapshots.go index a6cc88b90..066b98600 100644 --- a/turbo/snapshotsync/block_snapshots.go +++ b/turbo/snapshotsync/block_snapshots.go @@ -768,6 +768,23 @@ func DumpBodies(ctx context.Context, db kv.RoDB, segmentFilePath, tmpDir string, if err := f.Compress(); err != nil { return err } + + d, err := compress.NewDecompressor(segmentFilePath) + if err != nil { + return err + } + defer d.Close() + var buf []byte + if err := d.WithReadAhead(func() error { + g := d.MakeGetter() + for g.HasNext() { + buf, _ = g.Next(buf) + } + return nil + }); err != nil { + panic(err) + } + return nil }