aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filer_deletion.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filer/filer_deletion.go')
-rw-r--r--weed/filer/filer_deletion.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go
index d27e54954..84c5ed4c0 100644
--- a/weed/filer/filer_deletion.go
+++ b/weed/filer/filer_deletion.go
@@ -2,6 +2,7 @@ package filer
import (
"github.com/seaweedfs/seaweedfs/weed/storage"
+ "github.com/seaweedfs/seaweedfs/weed/util"
"strings"
"time"
@@ -117,7 +118,11 @@ func (f *Filer) DeleteUncommittedChunks(chunks []*filer_pb.FileChunk) {
f.doDeleteChunks(chunks)
}
-func (f *Filer) DeleteChunks(chunks []*filer_pb.FileChunk) {
+func (f *Filer) DeleteChunks(fullpath util.FullPath, chunks []*filer_pb.FileChunk) {
+ rule := f.FilerConf.MatchStorageRule(string(fullpath))
+ if rule.DisableChunkDeletion {
+ return
+ }
f.doDeleteChunks(chunks)
}
@@ -155,8 +160,7 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) {
toDelete, err := MinusChunks(f.MasterClient.GetLookupFileIdFunction(), oldChunks, newChunks)
if err != nil {
- glog.Errorf("Failed to resolve old entry chunks when delete old entry chunks. new: %s, old: %s",
- newChunks, oldChunks)
+ glog.Errorf("Failed to resolve old entry chunks when delete old entry chunks. new: %s, old: %s", newChunks, oldChunks)
return
}
f.DeleteChunksNotRecursive(toDelete)