Improve db_stress debuggability and fault-injection logging#14620
Closed
xingbowang wants to merge 5 commits intofacebook:mainfrom
Closed
Improve db_stress debuggability and fault-injection logging#14620xingbowang wants to merge 5 commits intofacebook:mainfrom
xingbowang wants to merge 5 commits intofacebook:mainfrom
Conversation
✅ clang-tidy: No findings on changed linesCompleted in 200.2s. |
Benchmark (DEBUG_LEVEL=1, iterator-heavy db_stress, median of 5 runs): - upstream/main: 10.04s - --trace_public_iterator_api=0: 10.13s (+0.9%) - --trace_public_iterator_api=1: 12.32s (+22.7%)
Benchmark (DEBUG_LEVEL=1, db_stress, 1 thread, readpercent=100, read_fault_one_in=1, ops_per_thread=1000000, median of 5 runs): - previous text log path: 3.45s - raw log path: 2.99s (-13.3%)
39109af to
cc314a3
Compare
|
@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D101066219. |
joshkang97
reviewed
Apr 20, 2026
Contributor
joshkang97
left a comment
There was a problem hiding this comment.
Seems like we're not wrapping all iterators, i.e. txn iterators and attribute-group iterators
Should we also trace Get variants as well?
| ) | ||
| ) | ||
|
|
||
| for _ in range(used_slots): |
Contributor
There was a problem hiding this comment.
we are tracing in slot order, but wouldn't it be better to print in timestamp or seqno order
| const uint64_t seq = | ||
| next_sequence_.fetch_add(1, std::memory_order_relaxed) + 1; | ||
| const uint64_t pos = log.head.fetch_add(1, std::memory_order_relaxed); | ||
| TraceEntry& entry = log.entries[pos % kEntriesPerThread]; |
Contributor
There was a problem hiding this comment.
This is mutating the ring buffer directly. What if there is a crash mid mutation, will there be a corrupt entry?
Contributor
Author
|
Discussed offline, we have a separate plan to preserve wal file from db stress test. No long need extra tracing. |
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
Benchmarks
db_stress(DEBUG_LEVEL=1):--trace_public_iterator_api=0was +0.9% vsupstream/main, while--trace_public_iterator_api=1was +22.7%db_stress(DEBUG_LEVEL=1, read faults): raw log path improved median runtime from 3.45s to 2.99s (-13.3%)Testing