preallocate disk space during compaction also, add cleanup for failed compaction

This commit is contained in:
Chris Lu
2017-08-29 23:59:53 -07:00
parent f7c22f0159
commit 58344980e4
10 changed files with 92 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/storage"
)
func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string) {
func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string, preallocate int64) {
go func() {
for {
if t.IsLeader() {
@@ -22,7 +22,7 @@ func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string) {
c := time.Tick(15 * time.Minute)
for _ = range c {
if t.IsLeader() {
t.Vacuum(garbageThreshold)
t.Vacuum(garbageThreshold, preallocate)
}
}
}(garbageThreshold)