Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

adding empty fsync

Chris Lu6bf31467c791
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index 160693c540..d3fb8283a7 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -17,7 +17,7 @@ import (
var _ = fs.Node(&File{})
// var _ = fs.NodeOpener(&File{})
-// var _ = fs.NodeFsyncer(&File{})
+var _ = fs.NodeFsyncer(&File{})
var _ = fs.Handle(&File{})
var _ = fs.HandleReadAller(&File{})
// var _ = fs.HandleReader(&File{})
@@ -98,10 +98,19 @@ func (file *File) ReadAll(ctx context.Context) (content []byte, err error) {
return content, err
}
-func (file *File) Flush(ctx context.Context, req *fuse.FlushRequest) error {
+func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error {
+ // fsync works at OS level
// write the file chunks to the filer
fmt.Printf("flush file %+v\n", req)
+ return nil
+}
+
+func (file *File) Flush(ctx context.Context, req *fuse.FlushRequest) error {
+ // fflush works at file level
+ // send the data to the OS
+ fmt.Printf("flush file %+v\n", req)
+
err := file.wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.AppendFileChunksRequest{