diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-16 08:26:51 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-16 08:26:51 -0800 |
| commit | 23014b68109fd769e8dfb6bfbeba6dd4a5af6ea8 (patch) | |
| tree | 54307b3bc2381a6ba2d7c980d7a41bbec866cc02 | |
| parent | 97dcae827b4062c147957128e77ae4c673e91e45 (diff) | |
| parent | b789767cd1059eeba393e3bdcf98b136e64db6eb (diff) | |
| download | seaweedfs-23014b68109fd769e8dfb6bfbeba6dd4a5af6ea8.tar.xz seaweedfs-23014b68109fd769e8dfb6bfbeba6dd4a5af6ea8.zip | |
Merge branch 'master' into support_ssd_volume
| -rw-r--r-- | README.md | 22 | ||||
| -rw-r--r-- | docker/Dockerfile.go_build | 2 | ||||
| -rw-r--r-- | docker/Dockerfile.go_build_large | 2 | ||||
| -rw-r--r-- | note/shuguang.png | bin | 0 -> 12252 bytes | |||
| -rw-r--r-- | weed/command/filer_copy.go | 4 | ||||
| -rw-r--r-- | weed/server/filer_server_handlers_write_autochunk.go | 6 | ||||
| -rw-r--r-- | weed/storage/disk_location.go | 12 |
7 files changed, 22 insertions, 26 deletions
@@ -8,7 +8,7 @@  -<h2 align="center">Supporting SeaweedFS</h2> +<h2 align="center"><a href="https://www.patreon.com/seaweedfs">Sponsor SeaweedFS via Patreon</a></h2> SeaweedFS is an independent Apache-licensed open source project with its ongoing development made possible entirely thanks to the support of these awesome [backers](https://github.com/chrislusf/seaweedfs/blob/master/backers.md). @@ -17,8 +17,6 @@ If you'd like to grow SeaweedFS even stronger, please consider joining our Your support will be really appreciated by me and other supporters! -<h3 align="center"><a href="https://www.patreon.com/seaweedfs">Sponsor SeaweedFS via Patreon</a></h3> - <!-- <h4 align="center">Platinum</h4> @@ -27,23 +25,11 @@ Your support will be really appreciated by me and other supporters! Add your name or icon here </a> </p> +--> -<h4 align="center">Gold</h4> - -<table> - <tbody> - <tr> - <td align="center" valign="middle"> - <a href="" target="_blank"> - Add your name or icon here - </a> - </td> - </tr> - <tr></tr> - </tbody> -</table> ---> +### Gold Sponsors + --- diff --git a/docker/Dockerfile.go_build b/docker/Dockerfile.go_build index 29b9a85d8..a5f8725e0 100644 --- a/docker/Dockerfile.go_build +++ b/docker/Dockerfile.go_build @@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder RUN apk add git go g++ RUN mkdir -p /go/src/github.com/chrislusf/ RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs +ARG branch=${branch:-master} +RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && go install -ldflags "${LDFLAGS}" diff --git a/docker/Dockerfile.go_build_large b/docker/Dockerfile.go_build_large index fa22aeade..c3ea4e606 100644 --- a/docker/Dockerfile.go_build_large +++ b/docker/Dockerfile.go_build_large @@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder RUN apk add git go g++ RUN mkdir -p /go/src/github.com/chrislusf/ RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs +ARG branch=${branch:-master} +RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && go install -tags 5BytesOffset -ldflags "${LDFLAGS}" diff --git a/note/shuguang.png b/note/shuguang.png Binary files differnew file mode 100644 index 000000000..54b6d0b6b --- /dev/null +++ b/note/shuguang.png diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index cc356de88..1b5f4c849 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -159,7 +159,7 @@ func runCopy(cmd *Command, args []string) bool { defer close(fileCopyTaskChan) for _, fileOrDir := range fileOrDirs { if err := genFileCopyTask(fileOrDir, urlPath, fileCopyTaskChan); err != nil { - fmt.Fprintf(os.Stderr, "gen file list error: %v\n", err) + fmt.Fprintf(os.Stderr, "genFileCopyTask : %v\n", err) break } } @@ -202,7 +202,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi fi, err := os.Stat(fileOrDir) if err != nil { - fmt.Fprintf(os.Stderr, "Failed to get stat for file %s: %v\n", fileOrDir, err) + fmt.Fprintf(os.Stderr, "Error: read file %s: %v\n", fileOrDir, err) return nil } diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index e52e20a8a..0cfbeba47 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -57,7 +57,11 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r * reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, so) } if err != nil { - writeJsonError(w, r, http.StatusInternalServerError, err) + if strings.HasPrefix(err.Error(), "read input:") { + writeJsonError(w, r, 499, err) + } else { + writeJsonError(w, r, http.StatusInternalServerError, err) + } } else if reply != nil { if len(md5bytes) > 0 { w.Header().Set("Content-MD5", util.Base64Encode(md5bytes)) diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go index 7030900dc..c6619b260 100644 --- a/weed/storage/disk_location.go +++ b/weed/storage/disk_location.go @@ -101,12 +101,14 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne } // avoid loading one volume more than once - l.volumesLock.RLock() - _, found := l.volumes[vid] - l.volumesLock.RUnlock() - if found { + l.volumesLock.Lock() + if _, found := l.volumes[vid]; found { + l.volumesLock.Unlock() glog.V(1).Infof("loaded volume, %v", vid) return true + } else { + l.volumes[vid] = nil + l.volumesLock.Unlock() } // load the volume @@ -115,7 +117,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne glog.V(0).Infof("new volume %s error %s", volumeName, e) return false } - + l.SetVolume(vid, v) size, _, _ := v.FileStat() |
