Browse Source

filer: do not always save files in "/etc" folder to filer store

fix https://github.com/seaweedfs/seaweedfs/issues/3476
pull/3458/head
chrislu 2 years ago
parent
commit
fef9c6a520
  1. 2
      weed/filer/filer_conf.go
  2. 4
      weed/server/filer_server_handlers_write_upload.go

2
weed/filer/filer_conf.go

@ -17,7 +17,7 @@ import (
)
const (
DirectoryEtcRoot = "/etc"
DirectoryEtcRoot = "/etc/"
DirectoryEtcSeaweedFS = "/etc/seaweedfs"
DirectoryEtcRemote = "/etc/remote"
FilerConfName = "filer.conf"

4
weed/server/filer_server_handlers_write_upload.go

@ -9,12 +9,10 @@ import (
"io"
"net/http"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -83,7 +81,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
break
}
if chunkOffset == 0 && !isAppend {
if dataSize < fs.option.SaveToFilerLimit || strings.HasPrefix(r.URL.Path, filer.DirectoryEtcRoot) {
if dataSize < fs.option.SaveToFilerLimit {
chunkOffset += dataSize
smallContent = make([]byte, dataSize)
bytesBuffer.Read(smallContent)

Loading…
Cancel
Save