Skip to content

Commit

Permalink
Complete MPU when allowed and under memory pressure
Browse files Browse the repository at this point in the history
Fixes hang in a rather simple case:

rm mnt/file && \
fio -name=test -ioengine=libaio -direct=1 -iodepth=4 -bsrange=4k-512k \
    -rw=write -size=10G -filename=mnt/file && \
fio -name=test -ioengine=libaio -direct=1 -iodepth=4 -bsrange=4k-512k \
    -rw=randwrite -size=10G -filename=mnt/file

Previous fixes to "infinite loop" + GetHoles fix the same case but with
~15s pause between fio write and randwrite to allow GeeseFS to complete
MPU at least once
  • Loading branch information
vitalif committed Mar 20, 2024
1 parent 2366e87 commit 4856ab1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ func (inode *Inode) sendUpload() bool {

canComplete = canComplete && !inode.IsRangeLocked(0, inode.Attributes.Size, true)

if canComplete && (inode.fileHandles == 0 || inode.forceFlush) {
if canComplete && (inode.fileHandles == 0 || inode.forceFlush || atomic.LoadInt32(&inode.fs.wantFree) > 0) {
// Complete the multipart upload
inode.IsFlushing += inode.fs.flags.MaxParallelParts
atomic.AddInt64(&inode.fs.stats.flushes, 1)
Expand Down

0 comments on commit 4856ab1

Please sign in to comment.