Repository navigation
Run the lazy entity tests with a recording file system on the test Env (#15815) - #15815
Open
xingbowang wants to merge 1 commit into
Open
xingbowang wants to merge 1 commit into
xingbowang wants to merge 1 commit into
Conversation
|
@xingbowang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134916660. |
✅ clang-tidy: No findings on changed linesCompleted in 349.6s. |
xingbowang
force-pushed
the
export-D134916660
branch
from
November 29, 2026 13:27
4464ea8 to
402e9f2
Compare
xingbowang
added a commit
to xingbowang/rocksdb
that referenced
this pull request
Nov 29, 2026
meta#15815) Summary: Pull Request resolved: meta#15815 `DBLazyEntityEmbeddedMultiReadTest.EmptyRangeInsideMergedReadGetsOK` fails in the CI job that runs the unit tests with `ENCRYPTED_ENV=1` (build-linux-encrypted_env-no_compression). The test came from meta#15780. Background: `DBTestBase::env_` is the Env of the test run. It is an encrypted Env with `ENCRYPTED_ENV`, and an in-memory Env with `MEM_ENV`. Most tests in db/wide/db_lazy_entity_test.cc open the DB on `env_`. 18 tests instead count the reads that reach the files, so they put a recording file system (`BlobReadIOActivityFS`) under the DB. Each of them built it on `FileSystem::Default()`, at 8 places (from meta#15067, meta#15178 and meta#15780). So these DBs always ran on the local disk with no encryption: - The failing test reads the DB's SST through `env_` to get the expected bytes. With `ENCRYPTED_ENV`, `env_` decrypts the plain file into other bytes, and the comparison fails. - With `ENCRYPTED_ENV`, the other 17 tests passed but did not run with encryption. - With `MEM_ENV`, the tests crashed, because the DB and the test fixture used different file systems. The fixture `DBLazyEntityTest` now has one helper, `UseRecordingFs()`, that builds the recording file system on `env_->GetFileSystem()`, sets it in the options, and keeps it alive until the fixture closes the DB. The 18 tests use it instead of their own setup. Only the test file changes; no RocksDB code changes. Differential Revision: D134916660
xingbowang
force-pushed
the
export-D134916660
branch
from
November 29, 2026 13:29
402e9f2 to
3b8e9b1
Compare
xingbowang
added a commit
to xingbowang/rocksdb
that referenced
this pull request
Nov 29, 2026
meta#15815) Summary: Before this change, `DBLazyEntityEmbeddedMultiReadTest.EmptyRangeInsideMergedReadGetsOK` failed in the CI job that runs the unit tests with `ENCRYPTED_ENV=1` (build-linux-encrypted_env-no_compression). The test came from meta#15780. Background: `DBTestBase::env_` is the Env of the test run. It is an encrypted Env with `ENCRYPTED_ENV`, and an in-memory Env with `MEM_ENV`. Most tests in db/wide/db_lazy_entity_test.cc open the DB on `env_`. 18 tests instead count the reads that reach the files, so they put a recording file system (`BlobReadIOActivityFS`) under the DB. Each of them built it on `FileSystem::Default()`, at 8 places (from meta#15067, meta#15178 and meta#15780). So these DBs always ran on the local disk with no encryption: - The failing test reads the DB's SST through `env_` to get the expected bytes. With `ENCRYPTED_ENV`, `env_` decrypts the plain file into other bytes, and the comparison fails. - With `ENCRYPTED_ENV`, the other 17 tests passed but did not run with encryption. - With `MEM_ENV`, the tests crashed, because the DB and the test fixture used different file systems. The mismatch went unnoticed because local runs and internal CI run these tests without `ENCRYPTED_ENV` or `MEM_ENV`. Only the open-source CI job runs `make check` with `ENCRYPTED_ENV=1`, and no CI job runs this binary with `MEM_ENV`. The earlier places only lost coverage under encryption; the failure appeared when meta#15780 added the first test that also reads the DB's files through `env_`. The fixture `DBLazyEntityTest` now has one helper, `UseRecordingFs()`, that builds the recording file system on `env_->GetFileSystem()`, sets it in the options, and keeps it alive until the fixture closes the DB. The 18 tests use it instead of their own setup. `env_->GetFileSystem()` is the base that most db tests use for such wrappers (for example `FaultInjectionTestFS`). The recorder sits above the encryption layer, so the tests still check what the SST and blob readers send to the file system. Only the test file changes; no RocksDB code changes. Loose end: other db test files also build file system wrappers on `FileSystem::Default()`. Some may need the local disk on purpose. Checking them is left for a follow-up. Differential Revision: D134916660
xingbowang
force-pushed
the
export-D134916660
branch
from
November 29, 2026 13:35
3b8e9b1 to
7e63855
Compare
meta#15815) Summary: Pull Request resolved: meta#15815 Before this change, `DBLazyEntityEmbeddedMultiReadTest.EmptyRangeInsideMergedReadGetsOK` failed in the CI job that runs the unit tests with `ENCRYPTED_ENV=1` (build-linux-encrypted_env-no_compression). The test came from meta#15780. Background: `DBTestBase::env_` is the Env of the test run. It is an encrypted Env with `ENCRYPTED_ENV`, and an in-memory Env with `MEM_ENV`. Most tests in db/wide/db_lazy_entity_test.cc open the DB on `env_`. 18 tests instead count the reads that reach the files, so they put a recording file system (`BlobReadIOActivityFS`) under the DB. Each of them built it on `FileSystem::Default()`, at 8 places (from meta#15067, meta#15178 and meta#15780). So these DBs always ran on the local disk with no encryption: - The failing test reads the DB's SST through `env_` to get the expected bytes. With `ENCRYPTED_ENV`, `env_` decrypts the plain file into other bytes, and the comparison fails. - With `ENCRYPTED_ENV`, the other 17 tests passed but did not run with encryption. - With `MEM_ENV`, the tests crashed, because the DB and the test fixture used different file systems. The mismatch went unnoticed because local runs and internal CI run these tests without `ENCRYPTED_ENV` or `MEM_ENV`. Only the open-source CI job runs `make check` with `ENCRYPTED_ENV=1`, and no CI job runs this binary with `MEM_ENV`. The earlier places only lost coverage under encryption; the failure appeared when meta#15780 added the first test that also reads the DB's files through `env_`. The fixture `DBLazyEntityTest` now has one helper, `UseRecordingFs()`, that builds the recording file system on `env_->GetFileSystem()`, sets it in the options, and keeps it alive until the fixture closes the DB. The 18 tests use it instead of their own setup. `env_->GetFileSystem()` is the base that most db tests use for such wrappers (for example `FaultInjectionTestFS`). The recorder sits above the encryption layer, so the tests still check what the SST and blob readers send to the file system. Only the test file changes; no RocksDB code changes. Loose end: other db test files also build file system wrappers on `FileSystem::Default()`. Some may need the local disk on purpose. Checking them is left for a follow-up. Differential Revision: D134916660
xingbowang
force-pushed
the
export-D134916660
branch
from
November 29, 2026 13:36
7e63855 to
3f7e029
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Before this change,
DBLazyEntityEmbeddedMultiReadTest.EmptyRangeInsideMergedReadGetsOKfailed in the CI job that runs the unit tests withENCRYPTED_ENV=1(build-linux-encrypted_env-no_compression). The test came from #15780.Background:
DBTestBase::env_is the Env of the test run. It is an encrypted Env withENCRYPTED_ENV, and an in-memory Env withMEM_ENV. Most tests in db/wide/db_lazy_entity_test.cc open the DB onenv_. 18 tests instead count the reads that reach the files, so they put a recording file system (BlobReadIOActivityFS) under the DB. Each of them built it onFileSystem::Default(), at 8 places (from #15067, #15178 and #15780). So these DBs always ran on the local disk with no encryption:env_to get the expected bytes. WithENCRYPTED_ENV,env_decrypts the plain file into other bytes, and the comparison fails.ENCRYPTED_ENV, the other 17 tests passed but did not run with encryption.MEM_ENV, the tests crashed, because the DB and the test fixture used different file systems.The mismatch went unnoticed because local runs and internal CI run these tests without
ENCRYPTED_ENVorMEM_ENV. Only the open-source CI job runsmake checkwithENCRYPTED_ENV=1, and no CI job runs this binary withMEM_ENV. The earlier places only lost coverage under encryption; the failure appeared when #15780 added the first test that also reads the DB's files throughenv_.The fixture
DBLazyEntityTestnow has one helper,UseRecordingFs(), that builds the recording file system onenv_->GetFileSystem(), sets it in the options, and keeps it alive until the fixture closes the DB. The 18 tests use it instead of their own setup.env_->GetFileSystem()is the base that most db tests use for such wrappers (for exampleFaultInjectionTestFS). The recorder sits above the encryption layer, so the tests still check what the SST and blob readers send to the file system. Only the test file changes; no RocksDB code changes.Loose end: other db test files also build file system wrappers on
FileSystem::Default(). Some may need the local disk on purpose. Checking them is left for a follow-up.Differential Revision: D134916660