Skip to content

Commit bfd16b4

Browse files
committed
Try to not flush zero parts, last part and do not complete MPU under memory pressure but when flush is not forced
1 parent ff16047 commit bfd16b4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/file.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ func (inode *Inode) SendUpload() bool {
15641564
// Pick part(s) to flush
15651565
initiated := false
15661566
lastPart := uint64(0)
1567-
flushInode := inode.fileHandles == 0 || inode.forceFlush || atomic.LoadInt32(&inode.fs.wantFree) > 0
1567+
flushInode := inode.fileHandles == 0 || inode.forceFlush
15681568
partDirty := false
15691569
partLocked := false
15701570
partEvicted := false
@@ -1641,8 +1641,7 @@ func (inode *Inode) SendUpload() bool {
16411641
return true
16421642
}
16431643
}
1644-
if canComplete && (inode.fileHandles == 0 || inode.forceFlush ||
1645-
atomic.LoadInt32(&inode.fs.wantFree) > 0) {
1644+
if canComplete && flushInode {
16461645
// Complete the multipart upload
16471646
inode.IsFlushing += inode.fs.flags.MaxParallelParts
16481647
atomic.AddInt64(&inode.fs.activeFlushers, 1)

0 commit comments

Comments
 (0)