Open pdillinger opened 3 weeks ago
@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.
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