Add option to disable allow_fallocate for RocksDB #1462

Open
opened 2026-02-26 12:42:36 +00:00 by tb148 · 7 comments

In RocksDB, it is recommended to disable allow_fallocate when using BTRFS. (See here)
On my server, this had caused Continuwuity to consume gigabytes of disk space.

In RocksDB, it is recommended to disable `allow_fallocate` when using BTRFS. (See [here](https://github.com/facebook/rocksdb/blob/c311362ab6e9143ff27ff8ae8aedfe2f0b05e99b/include/rocksdb/options.h#L1083)) On my server, this had caused Continuwuity to consume gigabytes of disk space.

allow_fallocate is not supported by rust-rocksdb (see: rust-rocksdb/rust-rocksdb#260), so this may not be possible. You may be able to achieve something similar by setting rocksdb::Options::set_manifest_preallocation_size to 0, but that feels hacky, and it'd have to be tested to confirm viability.

`allow_fallocate` is not supported by `rust-rocksdb` (see: [rust-rocksdb/rust-rocksdb#260](https://github.com/rust-rocksdb/rust-rocksdb/issues/260)), so this may not be possible. You may be able to achieve something similar by setting [`rocksdb::Options::set_manifest_preallocation_size`](https://docs.rs/rocksdb/latest/rocksdb/struct.Options.html#method.set_manifest_preallocation_size) to 0, but that feels hacky, and it'd have to be tested to confirm viability.
Owner

we do use the zaidoon1 soft fork, not sure what settings that adds

we do use the zaidoon1 soft fork, not sure what settings that adds
Owner

I mean to be honest I woudn't recommend running a database on btrfs (or a CoW fs) to begin with, xfs and ext4 are better suited to that task.

I mean to be honest I woudn't recommend running a database on btrfs (or a CoW fs) to begin with, xfs and ext4 are better suited to that task.

@Jade wrote in #1462 (comment):

we do use the zaidoon1 soft fork, not sure what settings that adds

Sadly, the situation for allow_fallocate is still missing there. It seems more likely to get a PR in on the fork, though.

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/1462#issuecomment-25176: > we do use the zaidoon1 soft fork, not sure what settings that adds Sadly, the situation for `allow_fallocate` [is still missing there](https://github.com/zaidoon1/rust-rocksdb/blob/master/src/db_options.rs). It seems more likely to get a PR in on the fork, though.
Author

Currently the temporary fix i'm using is to compile RocksDB without the WITH_FALLOCATE flag.

Currently the temporary fix i'm using is to compile RocksDB without the `WITH_FALLOCATE` flag.
Blocked on [zaidoon1/rust-rocksdb#204](https://github.com/zaidoon1/rust-rocksdb/pull/204).
Contributor

@Jade wrote in #1462 (comment):

I mean to be honest I woudn't recommend running a database on btrfs (or a CoW fs) to begin with, xfs and ext4 are better suited to that task.

some folks (including me) do run on CoW filesystems / BTRFS though, and having a separate partition just for continuwuity's database seems very overkill to me. that being said, apart from fallocate, running on btrfs seems fine to me (i've not had any issues so far)

@Jade wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/1462#issuecomment-25177: > I mean to be honest I woudn't recommend running a database on btrfs (or a CoW fs) to begin with, xfs and ext4 are better suited to that task. some folks (including me) *do* run on CoW filesystems / BTRFS though, and having a separate partition just for continuwuity's database seems very overkill to me. that being said, apart from fallocate, running on btrfs seems fine to me (i've not had any issues so far)
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1462
No description provided.