diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-12-24 14:55:50 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-12-24 14:55:50 -0800 |
| commit | efd2f50edecf698993dd228a7acd8ae4edd201ce (patch) | |
| tree | baf949a5a7c99c9f7e1244b8ab1dbe7bd0fd0f7a /weed/command/compact.go | |
| parent | 7ba6be23120890954b185e01af3a430cca2714b4 (diff) | |
| download | seaweedfs-efd2f50edecf698993dd228a7acd8ae4edd201ce.tar.xz seaweedfs-efd2f50edecf698993dd228a7acd8ae4edd201ce.zip | |
compaction changed to .idx based deletion
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) } } |
