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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
set initial write time to avoid race condition with delayed chunks
Chris Lu06e634109750
diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.goindex 3d3fac1842..feaf8945bb 100644--- a/weed/filesys/dirty_page.go+++ b/weed/filesys/dirty_page.go@@ -6,6 +6,7 @@ import ("github.com/chrislusf/seaweedfs/weed/pb/filer_pb""io""sync"+ "time")type ContinuousDirtyPages struct {@@ -81,6 +82,7 @@ func (pages *ContinuousDirtyPages) saveExistingLargestPageToStorage() (hasSavedDfunc (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64, size int64) {+ mtime := time.Now().UnixNano()pages.writeWaitGroup.Add(1)go func() {defer pages.writeWaitGroup.Done()@@ -94,19 +96,13 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64,pages.chunkSaveErrChan <- errreturn}+ chunk.Mtime = mtimepages.collection, pages.replication = collection, replicationpages.f.addChunks([]*filer_pb.FileChunk{chunk})pages.chunkSaveErrChan <- nil}()}-func maxUint64(x, y uint64) uint64 {- if x > y {- return x- }- return y-}-func max(x, y int64) int64 {if x > y {return x