mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
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:
parent
2762154130
commit
fef9c6a520
@ -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"
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user