diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-19 00:43:07 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-19 00:43:07 -0700 |
| commit | c27e18aa6a1c17190816d95876e45093646d477a (patch) | |
| tree | 4a3cfd503a9bee031a8eb85387b14d0e526b8f07 /weed/filer2/stream.go | |
| parent | a78772d5ea235e55ef515d1de28c2201ee9a5d66 (diff) | |
| download | seaweedfs-c27e18aa6a1c17190816d95876e45093646d477a.tar.xz seaweedfs-c27e18aa6a1c17190816d95876e45093646d477a.zip | |
read possible old deleted chunks
Diffstat (limited to 'weed/filer2/stream.go')
| -rw-r--r-- | weed/filer2/stream.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filer2/stream.go b/weed/filer2/stream.go index e9707d3ae..fee9d45da 100644 --- a/weed/filer2/stream.go +++ b/weed/filer2/stream.go @@ -32,7 +32,7 @@ func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*f for _, chunkView := range chunkViews { urlString := fileId2Url[chunkView.FileId] - err := util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err := util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { w.Write(data) }) if err != nil { @@ -63,7 +63,7 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err) return nil, err } - err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err = util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { buffer.Write(data) }) if err != nil { @@ -175,7 +175,7 @@ func (c *ChunkStreamReader) fetchChunkToBuffer(chunkView *ChunkView) error { return err } var buffer bytes.Buffer - err = util.ReadUrlAsStream(urlString, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { + err = util.ReadUrlAsStream(urlString+"?readDeleted=true", chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size), func(data []byte) { buffer.Write(data) }) if err != nil { |
