-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Set max_background_flushes dynamically #6701
Set max_background_flushes dynamically #6701
Conversation
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.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
6214da7
to
a72e4ca
Compare
@akankshamahajan15 has updated the pull request. Re-import the pull request |
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.
@akankshamahajan15 has imported this pull request. If you are a Facebook 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.
LGTM, a couple small comments.
db/db_options_test.cc
Outdated
Reopen(options); | ||
ASSERT_EQ(1, dbfull()->TEST_BGFlushesAllowed()); | ||
ASSERT_OK(dbfull()->SetDBOptions({{"max_background_flushes", "3"}})); | ||
auto stop_token = dbfull()->TEST_write_controler().GetStopToken(); |
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.
Did this GetStopToken()
come from the compaction equivalent of this test? I think it is relevant there but not here. It's needed there because RocksDB has a feature to limit compaction concurrency to one until compaction falls behind, after which it increases the limit to max_background_compactions
. That feature intends to help in multi-process scenarios (like MyRocks) to allocate more compaction bandwidth to the RocksDB instances that really need it.
The way it detects compaction fell behind is via these WriteController
tokens. So obtaining the token here would cause the number of compactions allowed to increase from one to max_background_compactions
. But AFAIK there is no analogous feature for flush, so we shouldn't need to acquire a token here.
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.
Yes, we don't need this. It is required in compaction test case. I will remove this one. Thanks!
ASSERT_OK(dbfull()->SetDBOptions({{"max_background_flushes", "3"}})); | ||
auto stop_token = dbfull()->TEST_write_controler().GetStopToken(); | ||
ASSERT_EQ(3, dbfull()->TEST_BGFlushesAllowed()); | ||
} |
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.
can we check env_->GetBackgroundThreads(Env::Priority::HIGH)
increase from one to three as well?
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.
Yes sure. I will add that check. Thanks!
a72e4ca
to
c8dd612
Compare
@akankshamahajan15 has updated the pull request. Re-import the pull request |
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.
@akankshamahajan15 has imported this pull request. If you are a Facebook 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.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: 1. Add changes so that max_background_flushes can be set dynamically. 2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the max_background_flushes dynamically using SetDBOptions. TestPlan: 1. make -j64 check 2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads
c8dd612
to
256895a
Compare
@akankshamahajan15 has updated the pull request. Re-import the pull request |
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.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@akankshamahajan15 merged this pull request in 03a1d95. |
Summary: 1. Add changes so that max_background_flushes can be set dynamically. 2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the max_background_flushes dynamically using SetDBOptions. TestPlan: 1. make -j64 check 2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads Pull Request resolved: facebook#6701 Reviewed By: ajkr Differential Revision: D21028010 Pulled By: akankshamahajan15 fbshipit-source-id: 5f949e4a8fd3c32537b637947b7ee09a69cfc7c1 Signed-off-by: tabokie <xy.tao@outlook.com>
Summary: 1. Add changes so that max_background_flushes can be set dynamically. 2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the max_background_flushes dynamically using SetDBOptions. TestPlan: 1. make -j64 check 2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads Pull Request resolved: facebook#6701 Reviewed By: ajkr Differential Revision: D21028010 Pulled By: akankshamahajan15 fbshipit-source-id: 5f949e4a8fd3c32537b637947b7ee09a69cfc7c1 Signed-off-by: tabokie <xy.tao@outlook.com> Co-authored-by: Akanksha Mahajan <akankshamahajan@fb.com>
Summary: 1. Add changes so that max_background_flushes can be set dynamically. 2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the max_background_flushes dynamically using SetDBOptions. TestPlan: 1. make -j64 check 2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads Pull Request resolved: facebook#6701 Reviewed By: ajkr Differential Revision: D21028010 Pulled By: akankshamahajan15 fbshipit-source-id: 5f949e4a8fd3c32537b637947b7ee09a69cfc7c1 Signed-off-by: tabokie <xy.tao@outlook.com> Co-authored-by: Akanksha Mahajan <akankshamahajan@fb.com>
Summary: 1. Add changes so that max_background_flushes can be set dynamically. 2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the max_background_flushes dynamically using SetDBOptions. TestPlan: 1. make -j64 check 2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads Pull Request resolved: facebook#6701 Reviewed By: ajkr Differential Revision: D21028010 Pulled By: akankshamahajan15 fbshipit-source-id: 5f949e4a8fd3c32537b637947b7ee09a69cfc7c1 Signed-off-by: tabokie <xy.tao@outlook.com> Co-authored-by: Akanksha Mahajan <akankshamahajan@fb.com> Co-authored-by: Akanksha Mahajan <akankshamahajan@fb.com>
Summary: 1. Add changes so that max_background_flushes can be set dynamically.
2. Add a testcase DBOptionsTest.SetBackgroundFlushThreads which set the
max_background_flushes dynamically using SetDBOptions.
TestPlan: 1. make -j64 check
2. Using new testcase DBOptionsTest.SetBackgroundFlushThreads