Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use fallocate for file size extension when supported #11541

Closed
wants to merge 1 commit into from

Conversation

zacw7
Copy link
Contributor

@zacw7 zacw7 commented Nov 14, 2024

When Copy-on-Write (COW) is disabled on Btrfs, automatic relocation creates snapshots of files, ignoring the noCOW setting. This results in increased disk usage and can lead to "no space left" errors in production.

One possible enhancement we can make is to use fallocate to reserve space immediately after file creation. This helps ensure the allocated space is as continuous as possible.

For environments where "no space left" errors are already happening, attempting to reserve space can result in failures. In that case, fallback to truncate and record it in runtime metrics.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 14, 2024
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 3d0b8bd
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/673e4c1b7e78e50008f016e9

@zacw7 zacw7 force-pushed the fallocate branch 2 times, most recently from 83b7711 to 4bed29d Compare November 14, 2024 22:55
@zacw7 zacw7 changed the title Use Velox fs for ssd cache evictlog file feat: Use fallocate for file size extension when supported Nov 14, 2024
@zacw7 zacw7 marked this pull request as ready for review November 14, 2024 23:52
@zacw7 zacw7 requested a review from majetideepak as a code owner November 14, 2024 23:52
@facebook-github-bot
Copy link
Contributor

@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zacw7 zacw7 requested a review from xiaoxmeng November 14, 2024 23:53
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zacw7 LGTM % minors. Thanks!

velox/common/base/Counters.cpp Show resolved Hide resolved
velox/common/base/Counters.cpp Outdated Show resolved Hide resolved
velox/common/caching/SsdFile.cpp Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.


namespace facebook::velox::cache::test {

class SsdFileTestHelper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a header file

zacw7 added a commit to zacw7/velox that referenced this pull request Nov 20, 2024
…ncubator#11541)

Summary:
When Copy-on-Write (COW) is disabled on Btrfs, automatic relocation creates snapshots of files, ignoring the noCOW setting. This results in increased disk usage and can lead to "no space left" errors in production.

One possible enhancement we can make is to use fallocate to reserve space immediately after file creation. This helps ensure the allocated space is as continuous as possible.

For environments where "no space left" errors are already happening, attempting to reserve space can result in failures. In that case, fallback to truncate and record it in runtime metrics.


Differential Revision: D65977522

Pulled By: zacw7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65977522

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zacw7 LGTM. Thanks!

namespace test {
class SsdCacheTestHelper;
}

class SsdCache {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove all existing testing methods from the two classes with test helper? thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it in a follow up PR?

zacw7 added a commit to zacw7/velox that referenced this pull request Nov 20, 2024
…ncubator#11541)

Summary:
When Copy-on-Write (COW) is disabled on Btrfs, automatic relocation creates snapshots of files, ignoring the noCOW setting. This results in increased disk usage and can lead to "no space left" errors in production.

One possible enhancement we can make is to use fallocate to reserve space immediately after file creation. This helps ensure the allocated space is as continuous as possible.

For environments where "no space left" errors are already happening, attempting to reserve space can result in failures. In that case, fallback to truncate and record it in runtime metrics.


Reviewed By: xiaoxmeng

Differential Revision: D65977522

Pulled By: zacw7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65977522

zacw7 added a commit to zacw7/velox that referenced this pull request Nov 20, 2024
…ncubator#11541)

Summary:
When Copy-on-Write (COW) is disabled on Btrfs, automatic relocation creates snapshots of files, ignoring the noCOW setting. This results in increased disk usage and can lead to "no space left" errors in production.

One possible enhancement we can make is to use fallocate to reserve space immediately after file creation. This helps ensure the allocated space is as continuous as possible.

For environments where "no space left" errors are already happening, attempting to reserve space can result in failures. In that case, fallback to truncate and record it in runtime metrics.


Differential Revision: D65977522

Pulled By: zacw7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65977522

…ncubator#11541)

Summary:
When Copy-on-Write (COW) is disabled on Btrfs, automatic relocation creates snapshots of files, ignoring the noCOW setting. This results in increased disk usage and can lead to "no space left" errors in production.

One possible enhancement we can make is to use fallocate to reserve space immediately after file creation. This helps ensure the allocated space is as continuous as possible.

For environments where "no space left" errors are already happening, attempting to reserve space can result in failures. In that case, fallback to truncate and record it in runtime metrics.


Reviewed By: xiaoxmeng

Differential Revision: D65977522

Pulled By: zacw7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65977522

@facebook-github-bot
Copy link
Contributor

@zacw7 merged this pull request in 0f6ba73.

@zacw7 zacw7 deleted the fallocate branch November 21, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants