aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-09 22:11:57 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-09 22:11:57 -0700
commit69655ba8e56c94cc1ef6fea5420c5a66d8fe650a (patch)
tree0bd2cf29571edbab12cfbe44e8e07f830449d4ec /weed/filesys/filehandle.go
parenta7012d9729cc5277114ac93580949fb487371395 (diff)
downloadseaweedfs-69655ba8e56c94cc1ef6fea5420c5a66d8fe650a.tar.xz
seaweedfs-69655ba8e56c94cc1ef6fea5420c5a66d8fe650a.zip
mount: cache on reading remote storage
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 9acede330..5cd7ca948 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -114,6 +114,16 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
return 0, io.EOF
}
+ if entry.IsInRemoteOnly() {
+ glog.V(4).Infof("download remote entry %s", fh.f.fullpath())
+ newEntry, err := fh.f.downloadRemoteEntry(entry)
+ if err != nil {
+ glog.V(1).Infof("download remote entry %s: %v", fh.f.fullpath(), err)
+ return 0, err
+ }
+ entry = newEntry
+ }
+
fileSize := int64(filer.FileSize(entry))
fileFullPath := fh.f.fullpath()