facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
27.83k stars 6.2k forks source link

Tag FaultInjectionIOType::kRead for FaultInjectionTestFS new read file & fix unreleased snapshot #12810

Closed hx235 closed 1 week ago

hx235 commented 1 week ago

Context/Summary: It makes more sense to mark error injection during creation as read file as "kread" so we don't get confusing msg like below

stderr:
 error : Get() returns IO error: injected metadata write error for key: 000000000000004F000000000000012B00000000000000EF.
Verification failed :(

Also an early return here https://github.com/facebook/rocksdb/blob/e0ddbee76fdc55b1e9f449b6e430b76291268786/db_stress_tool/db_stress_test_base.cc#L2871 can lead to unreleased snapshot upon DB restart Non-ok close status: Operation aborted: Cannot close DB with unreleased snapshot. This PR fixed it too.

Test: CI

facebook-github-bot commented 1 week ago

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

facebook-github-bot commented 1 week ago

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

facebook-github-bot commented 1 week ago

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

facebook-github-bot commented 1 week ago

@hx235 merged this pull request in facebook/rocksdb@6f79496475b147ce13ca8c2ebb6ace0cca9ef51d.