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

WIP: EnforceReadOpts #12765

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

pdillinger
Copy link
Contributor

Summary: Follow-up from #12757. New infrastructure to DEBUG builds to catch certain ReadOptions being ignored in a context where they should be in effect. This currently only applies to checking that no IO happens when read_tier == kBlockCacheTier. The check is in effect for unit tests and for stress/crash tests.

Specifically, an EnforceReadOpts object on the stack establishes a thread-local context under which we assert no IOs are performed if the provided ReadOptions said it should be forbidden.

Test Plan: Reports failure before production code fix in #12757

Summary: Follow-up from facebook#12757. New infrastructure to DEBUG builds to
catch certain ReadOptions being ignored in a context where they should
be in effect. This currently only applies to checking that no IO happens
when read_tier == kBlockCacheTier. The check is in effect for unit tests
and for stress/crash tests.

Specifically, an `EnforceReadOpts` object on the stack establishes a
thread-local context under which we assert no IOs are performed if the
provided ReadOptions said it should be forbidden.

Test Plan: Reports failure before production code fix in facebook#12757
@pdillinger
Copy link
Contributor Author

@hx235 We can continue the discussion about EnforceReadOpts here.

With regard to calling UsedIO from lower-level IO functions, I worry a bit about the fan-out to various implementations and functions, so I thought that block fetcher and prefetcher were pretty good places to catch between the caller fan-in and the implementation fan-out. Let me know if you have concrete suggestion.

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

2 participants