Browse Source

Merge branch 'master' into support_ssd_volume

pull/1794/head
Chris Lu 4 years ago
parent
commit
23014b6810
  1. 22
      README.md
  2. 2
      docker/Dockerfile.go_build
  3. 2
      docker/Dockerfile.go_build_large
  4. BIN
      note/shuguang.png
  5. 4
      weed/command/filer_copy.go
  6. 6
      weed/server/filer_server_handlers_write_autochunk.go
  7. 10
      weed/storage/disk_location.go

22
README.md

@ -8,7 +8,7 @@
![SeaweedFS Logo](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/seaweedfs.png) ![SeaweedFS Logo](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/seaweedfs.png)
<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 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). 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! 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> <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 Add your name or icon here
</a> </a>
</p> </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
![shuguang](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/shuguang.png)
--- ---

2
docker/Dockerfile.go_build

@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder
RUN apk add git go g++ RUN apk add git go g++
RUN mkdir -p /go/src/github.com/chrislusf/ RUN mkdir -p /go/src/github.com/chrislusf/
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs 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 \ RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
&& go install -ldflags "${LDFLAGS}" && go install -ldflags "${LDFLAGS}"

2
docker/Dockerfile.go_build_large

@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder
RUN apk add git go g++ RUN apk add git go g++
RUN mkdir -p /go/src/github.com/chrislusf/ RUN mkdir -p /go/src/github.com/chrislusf/
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs 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 \ RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
&& go install -tags 5BytesOffset -ldflags "${LDFLAGS}" && go install -tags 5BytesOffset -ldflags "${LDFLAGS}"

BIN
note/shuguang.png

After

Width: 200  |  Height: 51  |  Size: 12 KiB

4
weed/command/filer_copy.go

@ -159,7 +159,7 @@ func runCopy(cmd *Command, args []string) bool {
defer close(fileCopyTaskChan) defer close(fileCopyTaskChan)
for _, fileOrDir := range fileOrDirs { for _, fileOrDir := range fileOrDirs {
if err := genFileCopyTask(fileOrDir, urlPath, fileCopyTaskChan); err != nil { 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 break
} }
} }
@ -202,7 +202,7 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi
fi, err := os.Stat(fileOrDir) fi, err := os.Stat(fileOrDir)
if err != nil { 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 return nil
} }

6
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) reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, so)
} }
if err != nil { 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 { } else if reply != nil {
if len(md5bytes) > 0 { if len(md5bytes) > 0 {
w.Header().Set("Content-MD5", util.Base64Encode(md5bytes)) w.Header().Set("Content-MD5", util.Base64Encode(md5bytes))

10
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 // 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) glog.V(1).Infof("loaded volume, %v", vid)
return true return true
} else {
l.volumes[vid] = nil
l.volumesLock.Unlock()
} }
// load the volume // load the volume

Loading…
Cancel
Save