channeldb: implement compaction

This commit adds the compaction feature of the bbolt compact to our bolt
backend. This will try to open the DB in read-only mode and create a
compacted copy in a temporary file. Once the compaction was successful,
the temporary file and the old source file are swapped atomically.
This commit is contained in:
Oliver Gugger committed 2020-11-13 10:19:50 +01:00
1 parent 35c1fad517
commit 505be0d8bc
5 files changed
+346 -11

No files matched your search

+1
View File
@@ -63,6 +63,7 @@ require (
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02
github.com/urfave/cli v1.18.0
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50
go.uber.org/zap v1.14.1 // indirect
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0