Repository navigation
[Auto refresh iterator] Fix dbstress run - attempt 1 - #13408
mszeszko-meta wants to merge 4 commits into
Conversation
|
@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@mszeszko-meta could you do oncall a favor by running some rehearsal (larger scale) stress test in CI? I will ping you with steps. |
|
After talking to author, it turns out he already ran that. Manual run here means rehearsal CI run! Very nice and proactive testing strategy @mszeszko-meta @pdillinger |
| if (!ignore_injected_read_error_in_iter && | ||
| !SharedState::ignore_read_error && injected_error_count > 0 && |
There was a problem hiding this comment.
Is it possible to use the hack of IGNORE_STATUS_IF_ERROR() and SharedState::ignore_read_error to narrow the scope of ignoring injected read here?
There was a problem hiding this comment.
Fair point, @hx235. When I looked at it first time, I was a bit skeptical since it would require finding all the places where such injected read error failure can occur downstream of DoRefresh. That being said, upon reviewing all 14 cases of DoRefresh error injections [1] from T214812411, it appears that this option might be feasible as we de-facto (probably) only have to patch DBImpl::DeleteObsoleteFileImpl and WalManager::PurgeObsoleteWALFiles. The only risk here is whack-a-mole game with popping up errors (potentially across several followup PRs) + getting some more noise (breaking places that potentially already deal with this subtlety in their 'own way'). The reward would be defining more explicit contract for where failure is expected, which perhaps would help us catch other regressions. In addition, patching those call sites would not only benefit the iterator auto refresh scenario, but rather all the cases where obsolete files are being cleaned up improving the overall dbstress health. I think it's worth giving it a shot in a separate, followup PR once we stabilize the iterator auto refresh with the current, explicit check. What do you think?
[1]
DeleteObsoleteFileImpl => DeleteDBFile (5)
PurgeObsoleteWALFiles => DeleteDBFile (1)
PurgeObsoleteWALFiles => GetFileModificationTime (7)
PurgeObsoleteWALFiles => GetFileSize (1)There was a problem hiding this comment.
Thanks for looking into this. The plan is good with me!
getting some more noise (breaking places that potentially already deal with this subtlety in their 'own way').
This makes me re-think about whether IGNORE_STATUS_IF_ERROR() is still a useful practice ... opened a task for myself
There was a problem hiding this comment.
getting some more noise (breaking places that potentially already deal with this subtlety in their 'own way').
Right now for stress test, ignore_read_error is a thread-local. So adding IGNORE_STATUS_IF_ERROR() should only impact the test thread calling it. Given we also do SharedState::ignore_read_error = false at the beginning of the function, so I believe the impact will even be constrained to the function scope.
The design in our code that leads to using IGNORE_STATUS_IF_ERROR() or other error ignore flag is the error status is not propagated properly to upper level e.g, XXXIter::, destructor... Some ignoring is for the good purpose.
I still see the value of using IGNORE_STATUS_IF_ERROR() just so we don't have two error ignore mechanism in stress test, which we don't right now.
There was a problem hiding this comment.
I think IGNORE_STATUS_IF_ERROR() (combined with good discipline of resetting ignore_read_error at the beginning of the function / next loop iteration) is definitely a useful practice . It allows us to assert on failures 'in general' unless we explicitly request those to be marked as ignored in the code. Here is the timeline I have in mind:
- Let current change bake for 2-3 days, make sure dbstress stabilizes for auto refresh feature 50% on.
- Send out PR to wrap identified, non-returnable statuses with IGNORE_STATUS_IF_ERROR.
- Bake it for 2-3 days - make sure 2) did not regress any other tests.
- Remove the
ignore_injected_read_error_in_iteraltogether.
|
@mszeszko-meta has updated the pull request. You must reimport the pull request before landing. |
|
@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
dfe4dd0 to
9faffcb
Compare
|
@mszeszko-meta has updated the pull request. You must reimport the pull request before landing. |
|
@mszeszko-meta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@mszeszko-meta merged this pull request in 1e1c199. |
| DBIter::Direction direction) { | ||
| if (cfh_ != nullptr && read_options_.snapshot != nullptr && allow_refresh_ && | ||
| read_options_.auto_refresh_iterator_with_snapshot) { | ||
| read_options_.auto_refresh_iterator_with_snapshot && status().ok()) { |
There was a problem hiding this comment.
I think this could have performance implications. status() is a pretty complex call. Even with the best compiler optimizations I believe there's at least one virtual call from IteratorWrapperBase to whatever is implementing InternalIteratorBase::status(). Thus, it's probably cheaper to check the SV number first.
Summary: This change is addressing a valid concern raised in #13408 (comment). Pull Request resolved: #13415 Test Plan: Existing test collateral. Reviewed By: cbi42 Differential Revision: D69999071 Pulled By: mszeszko-meta fbshipit-source-id: 5ebb195b2b83701e06c33bfcb19c57d9ac1c1dc6
Summary: [Experiment] This PR is a followup to #13408. Thick bandaid of ignoring all injected read errors in context of periodic iterator auto refreshes in db stress proved to be effective. We confirmed our theory that errors are not a really a consequence / defect related to this new feature but rather due to subtle ways in which downstream code paths handle their respective IO failures. In this change we're replacing a thick 'ignore all IO read errors' bandaid in `no_batched_ops_stress` with a much smaller, targeted patches in obsolete files purge / delete codepaths, table block cache reader, table cache lookup to make sure we don't miss signal and ensure there's a single mechanism for ignoring error injection in db stress tests. Pull Request resolved: #13447 Reviewed By: hx235 Differential Revision: D70794787 Pulled By: mszeszko-meta fbshipit-source-id: c5fcd4780d82357c407f53bf0bb22fc38f7bd277
Summary: This PR attempts to fix the **dbstress failures** post meta#13354. There are at least 2 high level categories of errors: 1) likely caused by wide-scope snapshot initialization ([issue found by Peter](meta#13354 (comment))), 2) lack of proper error propagation. Wrt 2), part of the problem is a real miss (we should condition auto refresh on `status().ok()` after calling to `Next` / `Prev`), but another part - [failure in propagating dbstress-injected read error](meta#13354 (comment)) in file deletion is expected and should not be asserted on in dbstress. Pull Request resolved: meta#13408 Test Plan: Confirmed there are no more errors after running sandcastle crashtest for each of the failing flavors: ```hcl https://www.internalfb.com/sandcastle/workflow/252201579138859344 https://www.internalfb.com/sandcastle/workflow/3233584532458171962 https://www.internalfb.com/sandcastle/workflow/1283525893806766134 https://www.internalfb.com/sandcastle/workflow/2796735368603351293 https://www.internalfb.com/sandcastle/workflow/3792030886252148966 https://www.internalfb.com/sandcastle/workflow/67553994428973733 https://www.internalfb.com/sandcastle/workflow/3886606478427208295 https://www.internalfb.com/sandcastle/workflow/1684346260642682928 https://www.internalfb.com/sandcastle/workflow/4197354852715406516 https://www.internalfb.com/sandcastle/workflow/535928355663233170 https://www.internalfb.com/sandcastle/workflow/3409224917925569737 ``` Reviewed By: cbi42 Differential Revision: D69869766 Pulled By: mszeszko-meta fbshipit-source-id: 7a5b121218fb1dc0a37887d6fe2a5c07e2b894cf
Summary: This change is addressing a valid concern raised in meta#13408 (comment). Pull Request resolved: meta#13415 Test Plan: Existing test collateral. Reviewed By: cbi42 Differential Revision: D69999071 Pulled By: mszeszko-meta fbshipit-source-id: 5ebb195b2b83701e06c33bfcb19c57d9ac1c1dc6
Summary: [Experiment] This PR is a followup to meta#13408. Thick bandaid of ignoring all injected read errors in context of periodic iterator auto refreshes in db stress proved to be effective. We confirmed our theory that errors are not a really a consequence / defect related to this new feature but rather due to subtle ways in which downstream code paths handle their respective IO failures. In this change we're replacing a thick 'ignore all IO read errors' bandaid in `no_batched_ops_stress` with a much smaller, targeted patches in obsolete files purge / delete codepaths, table block cache reader, table cache lookup to make sure we don't miss signal and ensure there's a single mechanism for ignoring error injection in db stress tests. Pull Request resolved: meta#13447 Reviewed By: hx235 Differential Revision: D70794787 Pulled By: mszeszko-meta fbshipit-source-id: c5fcd4780d82357c407f53bf0bb22fc38f7bd277
Summary: [Experiment] This PR is a followup to meta#13408. Thick bandaid of ignoring all injected read errors in context of periodic iterator auto refreshes in db stress proved to be effective. We confirmed our theory that errors are not a really a consequence / defect related to this new feature but rather due to subtle ways in which downstream code paths handle their respective IO failures. In this change we're replacing a thick 'ignore all IO read errors' bandaid in `no_batched_ops_stress` with a much smaller, targeted patches in obsolete files purge / delete codepaths, table block cache reader, table cache lookup to make sure we don't miss signal and ensure there's a single mechanism for ignoring error injection in db stress tests. Pull Request resolved: meta#13447 Reviewed By: hx235 Differential Revision: D70794787 Pulled By: mszeszko-meta fbshipit-source-id: c5fcd4780d82357c407f53bf0bb22fc38f7bd277
Summary: This PR attempts to fix the **dbstress failures** post meta#13354. There are at least 2 high level categories of errors: 1) likely caused by wide-scope snapshot initialization ([issue found by Peter](meta#13354 (comment))), 2) lack of proper error propagation. Wrt 2), part of the problem is a real miss (we should condition auto refresh on `status().ok()` after calling to `Next` / `Prev`), but another part - [failure in propagating dbstress-injected read error](meta#13354 (comment)) in file deletion is expected and should not be asserted on in dbstress. Pull Request resolved: meta#13408 Test Plan: Confirmed there are no more errors after running sandcastle crashtest for each of the failing flavors: ```hcl https://www.internalfb.com/sandcastle/workflow/252201579138859344 https://www.internalfb.com/sandcastle/workflow/3233584532458171962 https://www.internalfb.com/sandcastle/workflow/1283525893806766134 https://www.internalfb.com/sandcastle/workflow/2796735368603351293 https://www.internalfb.com/sandcastle/workflow/3792030886252148966 https://www.internalfb.com/sandcastle/workflow/67553994428973733 https://www.internalfb.com/sandcastle/workflow/3886606478427208295 https://www.internalfb.com/sandcastle/workflow/1684346260642682928 https://www.internalfb.com/sandcastle/workflow/4197354852715406516 https://www.internalfb.com/sandcastle/workflow/535928355663233170 https://www.internalfb.com/sandcastle/workflow/3409224917925569737 ``` Reviewed By: cbi42 Differential Revision: D69869766 Pulled By: mszeszko-meta fbshipit-source-id: 7a5b121218fb1dc0a37887d6fe2a5c07e2b894cf
Summary: This change is addressing a valid concern raised in meta#13408 (comment). Pull Request resolved: meta#13415 Test Plan: Existing test collateral. Reviewed By: cbi42 Differential Revision: D69999071 Pulled By: mszeszko-meta fbshipit-source-id: 5ebb195b2b83701e06c33bfcb19c57d9ac1c1dc6
Summary: [Experiment] This PR is a followup to meta#13408. Thick bandaid of ignoring all injected read errors in context of periodic iterator auto refreshes in db stress proved to be effective. We confirmed our theory that errors are not a really a consequence / defect related to this new feature but rather due to subtle ways in which downstream code paths handle their respective IO failures. In this change we're replacing a thick 'ignore all IO read errors' bandaid in `no_batched_ops_stress` with a much smaller, targeted patches in obsolete files purge / delete codepaths, table block cache reader, table cache lookup to make sure we don't miss signal and ensure there's a single mechanism for ignoring error injection in db stress tests. Pull Request resolved: meta#13447 Reviewed By: hx235 Differential Revision: D70794787 Pulled By: mszeszko-meta fbshipit-source-id: c5fcd4780d82357c407f53bf0bb22fc38f7bd277
This PR attempts to fix the dbstress failures post #13354. There are at least 2 high level categories of errors: 1) likely caused by wide-scope snapshot initialization (issue found by Peter), 2) lack of proper error propagation. Wrt 2), part of the problem is a real miss (we should condition auto refresh on
status().ok()after calling toNext/Prev), but another part - failure in propagating dbstress-injected read error in file deletion is expected and should not be asserted on in dbstress.Test plan
Confirmed there are no more errors after running sandcastle crashtest for each of the failing flavors: