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

fix https://github.com/seaweedfs/seaweedfs/issues/3476
This commit is contained in:
chrislu 2022-08-21 17:02:16 -07:00
parent 2762154130
commit fef9c6a520
2 changed files with 2 additions and 4 deletions

View file

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

View file

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