Skip to content

[stable9] Allow chunk GC mtime tolerance for unfinished part chunks - #24676

Merged
PVince81 merged 1 commit into
stable9from
stable9-fixchunkttl
May 18, 2016
Merged

PVince81 merged 1 commit into
stable9from
stable9-fixchunkttl

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Whenever part chunks are written, every fwrite in the write loop will
reset the mtime to the current mtime. Only at the end will the touch()
operation set the mtime to now + ttl, in the future.

However the GC code is expecting that every chunk with mtime < now are
old and must be deleted. This causes the GC to sometimes delete part
chunks in which the write loop is slow.

To fix this, a tolerance value is added in the GC code to allow for
more time before a part chunk gets deleted.

Please review/test @icewind1991 @Marginal @MorrisJobke @nickvergessen @schiesbn

With these steps and the fix I could not reproduce the issue: #24653 (comment)

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @DeepDiver1975, @LukasReschke and @MorrisJobke to be potential reviewers

@PVince81 PVince81 changed the title Allow chunk GC mtime tolerance for unfinished part chunks [stable9] Allow chunk GC mtime tolerance for unfinished part chunks May 17, 2016
@PVince81

Copy link
Copy Markdown
Contributor Author

Please don't merge yet, target is stable9 for now for testability.
Will provide a master fix if we all agree on this solution.

@PVince81 PVince81 added this to the 9.0.3-current-maintenance milestone May 17, 2016
@PVince81

Copy link
Copy Markdown
Contributor Author

CC @karlitschek @cmonteroluque for backport to 9.0, 8.2, 8.1, 8.0

This should solve most of the good old "Expected filesize X got 0" (the one with zero) errors...

@karlitschek

Copy link
Copy Markdown
Contributor

Awesome. Please backport.
Is the sleep command intentionally? ;-)
👍

@PVince81

Copy link
Copy Markdown
Contributor Author

Awww, forgot to remove it. It was useful for testing.

Whenever part chunks are written, every fwrite in the write loop will
reset the mtime to the current mtime. Only at the end will the touch()
operation set the mtime to now + ttl, in the future.

However the GC code is expecting that every chunk with mtime < now are
old and must be deleted. This causes the GC to sometimes delete part
chunks in which the write loop is slow.

To fix this, a tolerance value is added in the GC code to allow for
more time before a part chunk gets deleted.
@karlitschek

Copy link
Copy Markdown
Contributor

That's what I figured. Or we leave it in and claim a massive performance boost in the next release when we remove it ;-)

@Marginal

Copy link
Copy Markdown

Fixes the "expected filesize 5242880 got 0" errors for me on 9.0.2.2. Tested uploading 6 x 100MB files.

@rullzer

rullzer commented May 18, 2016

Copy link
Copy Markdown
Contributor

yeah if you can't upload 8k in an hour then you have bigger things to worry about!

👍

@rullzer

rullzer commented May 18, 2016

Copy link
Copy Markdown
Contributor

Should also go into master I assume?

@PVince81

Copy link
Copy Markdown
Contributor Author

Yes, I'll take care of submitting all the PRs soon

@PVince81

Copy link
Copy Markdown
Contributor Author

master PR here #24691

I'll list the other backports there

@Marginal

Copy link
Copy Markdown

👍

@lock

lock Bot commented Aug 5, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants