Repository navigation
Use ImmediateExit for db_stress MANIFEST verification failures - #15575
Closed
pdillinger wants to merge 1 commit into
Closed
pdillinger wants to merge 1 commit into
pdillinger wants to merge 1 commit into
Conversation
Summary: **Why:** when db_stress's MANIFEST-avoidance check fails on reopen, the crash test can report a misleading `Assertion 'property_info != nullptr' failed` in `DBImpl::DumpStats()` instead of the real failure. T287969622 collected four such hits (Sep 9 to Nov 1). Each started with a `FATAL: MANIFEST file grew by N bytes ...` or `FATAL: MANIFEST file was recreated ...` line from `StressTest::VerifyManifestNotRewritten()`. The task title, and the signature the automation groups by, came from the secondary assert. When the race does not happen, the same failure is filed under its own title instead (for example T288683405). **Previous behavior:** `StressTest::Reopen()` calls `VerifyManifestNotRewritten()` right after `Open()`, so the DB is open with live background threads, including the stats-dump `Timer`. The three STRICT-mode failure paths in that function (MANIFEST recreated, MANIFEST grew, CURRENT updated) called `exit(1)`. `exit()` runs static destructors. If the stats timer fires during that teardown, `DBImpl::DumpStats()` looks up a DB property in an already-destroyed static map and asserts, so the process aborts with signal 6. The Sep 9 analysis on T287969622 identified this race. **New behavior:** those three paths call `port::ImmediateExit(1)`, which wraps `_exit()`. The process prints the same FATAL message on stderr and exits with code 1 without running static destructors, so the stats timer can no longer turn it into a `DumpStats` assert. The crash test now reports the real failure. **Implementation:** replace `exit(1)` with `port::ImmediateExit(1)` at the three STRICT-mode failure sites in `VerifyManifestNotRewritten()`. D108298839 added `port::ImmediateExit()` for this kind of failure: an exit after DB open with background threads running. Other post-open db_stress exits already use it (`FinishInitDb()`, `TrackExpectedState()` and the open-error paths in `Open()`). **Safety and limitations:** db_stress only; no engine, API or format change. The remaining `exit(1)` calls in `db_stress_test_base.cc` are option-validation paths that run before the DB is opened, so they are left alone. `_exit()` skips flushing stdio buffers, so any buffered stdout from that run can be lost. The FATAL text goes to unbuffered stderr, as with the existing `ImmediateExit` sites. This does not fix the MANIFEST-avoidance failures themselves. T287969622 tracks those: one is fixed by D127204400, one (leftover `async_wal_precreate` WAL) still looks open, and the "MANIFEST recreated" variant is unexplained. Requested by: Peter Dillinger (peterd) Differential Revision: D129421184
|
@pdillinger has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129421184. |
✅ clang-tidy: No findings on changed linesCompleted in 113.9s. |
|
This pull request has been merged in e157424. |
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:
Why: when db_stress's MANIFEST-avoidance check fails on reopen, the crash test can report a misleading
Assertion 'property_info != nullptr' failedinDBImpl::DumpStats()instead of the real failure. T287969622 collected four such hits (Sep 9 to Nov 1). Each started with aFATAL: MANIFEST file grew by N bytes ...orFATAL: MANIFEST file was recreated ...line fromStressTest::VerifyManifestNotRewritten(). The task title, and the signature the automation groups by, came from the secondary assert. When the race does not happen, the same failure is filed under its own title instead (for example T288683405).Previous behavior:
StressTest::Reopen()callsVerifyManifestNotRewritten()right afterOpen(), so the DB is open with live background threads, including the stats-dumpTimer. The three STRICT-mode failure paths in that function (MANIFEST recreated, MANIFEST grew, CURRENT updated) calledexit(1).exit()runs static destructors. If the stats timer fires during that teardown,DBImpl::DumpStats()looks up a DB property in an already-destroyed static map and asserts, so the process aborts with signal 6. The Sep 9 analysis on T287969622 identified this race.New behavior: those three paths call
port::ImmediateExit(1), which wraps_exit(). The process prints the same FATAL message on stderr and exits with code 1 without running static destructors, so the stats timer can no longer turn it into aDumpStatsassert. The crash test now reports the real failure.Implementation: replace
exit(1)withport::ImmediateExit(1)at the three STRICT-mode failure sites inVerifyManifestNotRewritten(). D108298839 addedport::ImmediateExit()for this kind of failure: an exit after DB open with background threads running. Other post-open db_stress exits already use it (FinishInitDb(),TrackExpectedState()and the open-error paths inOpen()).Safety and limitations: db_stress only; no engine, API or format change. The remaining
exit(1)calls indb_stress_test_base.ccare option-validation paths that run before the DB is opened, so they are left alone._exit()skips flushing stdio buffers, so any buffered stdout from that run can be lost. The FATAL text goes to unbuffered stderr, as with the existingImmediateExitsites. This does not fix the MANIFEST-avoidance failures themselves. T287969622 tracks those: one is fixed by D127204400, one (leftoverasync_wal_precreateWAL) still looks open, and the "MANIFEST recreated" variant is unexplained.Requested by: Peter Dillinger (peterd)
Differential Revision: D129421184