-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Add io_buffer_size to BackupEngineOptions #13236
Conversation
1316c31
to
82348e9
Compare
147b60f
to
ac0178c
Compare
@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM
: kDefaultCopyFileBufferSize; | ||
size_t buf_size = CalculateIOBufferSize(rate_limiter); | ||
TEST_SYNC_POINT_CALLBACK( | ||
"BackupEngineImpl::CopyOrCreateFile:CalculateIOBufferSize", &buf_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync point is not my favorite here for testing about 1/2 to 2/3rds of the integrated data path of the setting when an existing callback mechanism (FileSystemWrapper / FSWritableFile / FSSequentialFile) could test the full end-to-end buffer size (probably tracking the max buffer size seen in existing TestFs in backup_engine_test). But it's ok.
a0e7bf6
to
fcc26da
Compare
@archang19 has updated the pull request. You must reimport the pull request before landing. |
@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@archang19 has updated the pull request. You must reimport the pull request before landing. |
@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1bfc7d7
to
5df6b7e
Compare
@archang19 has updated the pull request. You must reimport the pull request before landing. |
@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@archang19 merged this pull request in f7d32c1. |
Summary
The RocksDB backup engine code currently derives the IO buffer size based on the following criteria:
We want to be able to explicitly choose the IO size based on the storage backend. We want the new criteria to be:
BackupEngineOptions
This PR adds a new option called
io_buffer_size
toBackupEngineOptions
and updates the logic used to set the buffer size.Test Plan
I added a separate unit test and verified that we can either use the
io_buffer_size
, rate limiter burst size, or the default size.I decided to use a
TEST_SYNC_POINT_CALLBACK
. I considered the alternative of updating theRead
implementation ofDummySequentialFile
/CheckIOOptsSequentialFile
to check the value ofn
. However, that would have considerably complicated the whole test code, and we also do not need to be checking for this in every single test case. I think theTEST_SYNC_POINT_CALLBACK
turned out to be quite elegant.