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 (
DirectoryEtcRoot = "/etc"
DirectoryEtcRoot = "/etc/"
DirectoryEtcSeaweedFS = "/etc/seaweedfs"
DirectoryEtcRemote = "/etc/remote"
FilerConfName = "filer.conf"

View file

@ -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)