New FlushWAL() API to take extra fields such as rate limiter priority #14037
Closed
hx235 wants to merge 1 commit intofacebook:mainfrom
Closed
New FlushWAL() API to take extra fields such as rate limiter priority #14037hx235 wants to merge 1 commit intofacebook:mainfrom
hx235 wants to merge 1 commit intofacebook:mainfrom
Conversation
27fa90c to
12a956d
Compare
archang19
approved these changes
Oct 9, 2025
Contributor
archang19
left a comment
There was a problem hiding this comment.
To confirm I understand why we need this change and cannot use WriteOptions
https://github.com/facebook/rocksdb/blob/main/include/rocksdb/options.h#L2293-L2302 is the issue right? ("Currently the support covers automatic WAL flushes")
Contributor
Author
Right - the WriteOptions is associated with that particular write while FlushWAL() happens after that write. There is no way to carry that write option over in RocksDB. I also avoid using the WriteOptions since it's mostly for live write. Added more in summary |
xingbowang
pushed a commit
to xingbowang/rocksdb
that referenced
this pull request
Oct 13, 2025
…facebook#14037) Summary: **Context/Summary:** There is no way to tag or rate-limit write IO occurs during FlushWAL() with priority. Under `Options::manual_wal_flush=true`, it is the major source of write IO during user writes so we decide to add that support. A new option struct `FlushWALOptions` is introduced to avoid making the API ugly for future new fields. Also, we can't use the WriteOptions (https://github.com/facebook/rocksdb/blob/main/include/rocksdb/options.h#L2293-L2302 i) since is associated with that particular Put/Merge/.. associated with that option but FlushWAL() can happen after that write. There is no way to carry that write option over in RocksDB. I also avoided using the WriteOptions since it's mostly for live write. Pull Request resolved: facebook#14037 Test Plan: New UTs `TEST_P(DBRateLimiterOnManualWALFlushTest, ManualWALFlush)` Reviewed By: archang19 Differential Revision: D84193522 Pulled By: hx235 fbshipit-source-id: 18feb5235672010d19a101ce52c8abdcc4a789f2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context/Summary:
There is no way to tag or rate-limit write IO occurs during FlushWAL() with priority. Under
Options::manual_wal_flush=true, it is the major source of write IO during user writes so we decide to add that support. A new option structFlushWALOptionsis introduced to avoid making the API ugly for future new fields.Also, we can't use the WriteOptions (https://github.com/facebook/rocksdb/blob/main/include/rocksdb/options.h#L2293-L2302 i) since is associated with that particular Put/Merge/.. associated with that option but FlushWAL() can happen after that write. There is no way to carry that write option over in RocksDB. I also avoided using the WriteOptions since it's mostly for live write.
Test:
New UTs
TEST_P(DBRateLimiterOnManualWALFlushTest, ManualWALFlush)