diff options
| author | binbinshi <javabinbin@126.com> | 2020-02-05 16:56:23 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-05 16:56:23 +0800 |
| commit | d892cad15d748327c2b7c649f6398ff35d8dce0b (patch) | |
| tree | 29cb8adae01d9f4eaeabb02996d162700da2de1a /weed/command/compact.go | |
| parent | d4f755347e4874cf0a2fd13480580f348b86a465 (diff) | |
| parent | 8d94564f4152cd890d5896a3dedf5e7589c5023e (diff) | |
| download | seaweedfs-d892cad15d748327c2b7c649f6398ff35d8dce0b.tar.xz seaweedfs-d892cad15d748327c2b7c649f6398ff35d8dce0b.zip | |
Merge pull request #1 from chrislusf/master
update from chrisluf
Diffstat (limited to 'weed/command/compact.go')
| -rw-r--r-- | weed/command/compact.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/compact.go b/weed/command/compact.go index 4a54f5670..85313b749 100644 --- a/weed/command/compact.go +++ b/weed/command/compact.go @@ -17,6 +17,9 @@ var cmdCompact = &Command{ The compacted .dat file is stored as .cpd file. The compacted .idx file is stored as .cpx file. + For method=0, it compacts based on the .dat file, works if .idx file is corrupted. + For method=1, it compacts based on the .idx file, works if deletion happened but not written to .dat files. + `, } @@ -47,7 +50,7 @@ func runCompact(cmd *Command, args []string) bool { glog.Fatalf("Compact Volume [ERROR] %s\n", err) } } else { - if err = v.Compact2(); err != nil { + if err = v.Compact2(preallocate); err != nil { glog.Fatalf("Compact Volume [ERROR] %s\n", err) } } |
