Skip to content

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

Closed
hx235 wants to merge 2 commits into
meta:mainfrom
hx235:stress_sync_wal_not_supported
Closed

hx235 wants to merge 2 commits into
meta:mainfrom
hx235:stress_sync_wal_not_supported

Conversation

@hx235

@hx235 hx235 commented Oct 6, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

hx235 commented Oct 7, 2022

Copy link
Copy Markdown
Contributor Author

@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

@anand1976 anand1976 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hx235

hx235 commented Oct 10, 2022 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

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

@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

bool sync = thread->rand.OneIn(2) ? true : false;
Status s = db_->FlushWAL(sync);
if (!s.ok()) {
if (!s.ok() && !(sync && s.IsNotSupported())) {

Copy link
Copy Markdown
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.

Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
…a#10784)

Summary:
**Context:**
meta#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 meta#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

Pull Request resolved: meta#10784

Test Plan: make check

Reviewed By: anand1976

Differential Revision: D40193354

Pulled By: anand1976

fbshipit-source-id: e80d53880799ae01bdd717641d07997d3bfe2b54
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.

4 participants