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

Allow Flush(sync=true) not supported in DB::Open() and db_stress #10784

Closed
wants to merge 2 commits into from

Conversation

hx235
Copy link
Contributor

@hx235 hx235 commented Oct 6, 2022

Context:
#10698 made Flush(sync=true) required for DB::Open() (to pass the original but now deleted assertion impl->TEST_WALBufferIsEmpty() under manual_wal_flush=true, see #10698 summary for more ) as well as db_stress to pass.

However RocksDB users may not implement SyncWAL() (used inFlush(sync=true)). Therefore we replace such in DB::Open and db_stress in this PR and align with https://github.com/facebook/rocksdb/blob/main/db/db_impl/db_impl_open.cc#L1883-L1887 and https://github.com/facebook/rocksdb/blob/main/db_stress_tool/db_stress_test_base.cc#L847-L849

Test:
make check

@hx235 hx235 force-pushed the stress_sync_wal_not_supported branch from 41a68fa to 47d55d1 Compare October 7, 2022 20:58
@hx235 hx235 changed the title Allow Flush(sync=true) to be not supported in db_stress Allow Flush(sync=true) to be not supported in DB::Open() and db_stress Oct 7, 2022
@hx235 hx235 force-pushed the stress_sync_wal_not_supported branch 2 times, most recently from 65d0af4 to c4958a6 Compare October 7, 2022 21:21
@facebook-github-bot
Copy link
Contributor

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

@hx235 hx235 requested a review from anand1976 October 7, 2022 21:51
@hx235
Copy link
Contributor Author

hx235 commented Oct 7, 2022

@anand1976 Updated the DB::Open path and PR summary to reflect our offline discussion.

@hx235 hx235 changed the title Allow Flush(sync=true) to be not supported in DB::Open() and db_stress Allow Flush(sync=true) not supported in DB::Open() and db_stress Oct 7, 2022
Copy link
Contributor

@anand1976 anand1976 left a comment

Choose a reason for hiding this comment

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

LGTM

@hx235
Copy link
Contributor Author

hx235 commented Oct 10, 2022

Update to main

@hx235 hx235 force-pushed the stress_sync_wal_not_supported branch from c4958a6 to c6370ba Compare October 10, 2022 19:53
@facebook-github-bot
Copy link
Contributor

@hx235 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

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

@@ -836,7 +836,7 @@ void StressTest::OperateDb(ThreadState* thread) {
if (thread->rand.OneInOpt(FLAGS_manual_wal_flush_one_in)) {
bool sync = thread->rand.OneIn(2) ? true : false;
Status s = db_->FlushWAL(sync);
if (!s.ok()) {
if (!s.ok() && !(sync && s.IsNotSupported())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The below SyncWAL() appears susceptible to the same problem. Maybe let WS disable these features in their config until they complete support for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants