diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-11-19 18:16:44 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2020-11-19 18:16:44 +0500 |
| commit | 27e73de7975ff9f097bbfd8d2717aa27931f25b5 (patch) | |
| tree | 802f8cf0f7cc6834e03a24700a8d07a218f5bd86 /weed/filesys/dirty_page.go | |
| parent | e1190b3224638616cf4e1318ddcba0b1575f2130 (diff) | |
| parent | da04bb3d1bb60d92fdacfb2edd8c8bdba2643038 (diff) | |
| download | seaweedfs-27e73de7975ff9f097bbfd8d2717aa27931f25b5.tar.xz seaweedfs-27e73de7975ff9f097bbfd8d2717aa27931f25b5.zip | |
Merge branch 'upstream_master' into store_s3cred
# Conflicts:
# weed/s3api/filer_util.go
Diffstat (limited to 'weed/filesys/dirty_page.go')
| -rw-r--r-- | weed/filesys/dirty_page.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go index c1b78a220..11089186f 100644 --- a/weed/filesys/dirty_page.go +++ b/weed/filesys/dirty_page.go @@ -15,10 +15,10 @@ type ContinuousDirtyPages struct { intervals *ContinuousIntervals f *File writeWaitGroup sync.WaitGroup + chunkAddLock sync.Mutex chunkSaveErrChan chan error chunkSaveErrChanClosed bool lastErr error - lock sync.Mutex collection string replication string } @@ -117,6 +117,8 @@ func (pages *ContinuousDirtyPages) saveToStorage(reader io.Reader, offset int64, } chunk.Mtime = mtime pages.collection, pages.replication = collection, replication + pages.chunkAddLock.Lock() + defer pages.chunkAddLock.Unlock() pages.f.addChunks([]*filer_pb.FileChunk{chunk}) glog.V(3).Infof("%s saveToStorage [%d,%d)", pages.f.fullpath(), offset, offset+size) } |
