Enable MANIFEST optimization options in db_crashtest.py and add db_stress verification#14742
Enable MANIFEST optimization options in db_crashtest.py and add db_stress verification#14742anand1976 wants to merge 1 commit into
Conversation
|
@anand1976 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105224068. |
|
| Check | Count |
|---|---|
concurrency-mt-unsafe |
3 |
performance-inefficient-string-concatenation |
2 |
| Total | 5 |
Details
db_stress_tool/db_stress_test_base.cc (5 warning(s))
db_stress_tool/db_stress_test_base.cc:4337:52: warning: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation]
db_stress_tool/db_stress_test_base.cc:4393:52: warning: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation]
db_stress_tool/db_stress_test_base.cc:4410:7: warning: function is not thread safe [concurrency-mt-unsafe]
db_stress_tool/db_stress_test_base.cc:4444:11: warning: function is not thread safe [concurrency-mt-unsafe]
db_stress_tool/db_stress_test_base.cc:4482:11: warning: function is not thread safe [concurrency-mt-unsafe]
7372093 to
3750446
Compare
…ress verification (facebook#14742) Summary: This change enables testing of the two new MANIFEST optimization options introduced in D103568447: 1. optimize_manifest_for_recovery - Skips unnecessary MANIFEST edits during recovery 2. reuse_manifest_on_open - Reuses existing MANIFEST file on DB open Changes: - tools/db_crashtest.py: Add both options with 20% probability to default_params - db_stress_tool/db_stress_test_base.h: Add ManifestVerifyMode enum and member variables for tracking MANIFEST state - db_stress_tool/db_stress_test_base.cc: Implement RecordManifestStateBeforeReopen() and VerifyManifestNotRewritten() methods to validate MANIFEST reuse on DB reopen The verification logic handles 4 combinations: - Both disabled: No verification (baseline) - Only optimize enabled: No verification (hard to measure without sync points) - Only reuse enabled: Verify MANIFEST file is reused - Both enabled: Verify MANIFEST reused AND CURRENT unchanged Verification is warning-only (not fatal) to account for legitimate fallback cases like corruption or size limits. Reviewed By: hx235 Differential Revision: D105224068
3750446 to
33e3d07
Compare
…ress verification Summary: This change enables testing of the two new MANIFEST optimization options introduced in D103568447: 1. optimize_manifest_for_recovery - Skips unnecessary MANIFEST edits during recovery 2. reuse_manifest_on_open - Reuses existing MANIFEST file on DB open Changes: - tools/db_crashtest.py: Add both options with 20% probability to default_params - db_stress_tool/db_stress_test_base.h: Add ManifestVerifyMode enum and member variables for tracking MANIFEST state - db_stress_tool/db_stress_test_base.cc: Implement RecordManifestStateBeforeReopen() and VerifyManifestNotRewritten() methods to validate MANIFEST reuse on DB reopen The verification logic handles 4 combinations: - Both disabled: No verification (baseline) - Only optimize enabled: No verification (hard to measure without sync points) - Only reuse enabled: Verify MANIFEST file is reused - Both enabled: Verify MANIFEST reused AND CURRENT unchanged Verification is warning-only (not fatal) to account for legitimate fallback cases like corruption or size limits. Reviewed By: hx235 Differential Revision: D105224068
33e3d07 to
864bbb6
Compare
🟡 Codex Code ReviewAuto-triggered after CI passed — reviewing commit 864bbb6 ❌ Codex review failed before producing findings. ℹ️ About this responseGenerated by Codex CLI. Limitations:
Commands:
|
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 864bbb6 SummaryThis PR adds crash test coverage for two MANIFEST optimization options ( High-severity findings (1):
Full review (click to expand)Findings🔴 HIGHH1. Unchecked
|
| Context | Assumptions hold? | Action needed? |
|---|---|---|
| WritePreparedTxnDB | YES - verification is observational | Safe |
| best_efforts_recovery | YES - explicitly returns NONE | Safe |
| Fault injection (open) | YES - STRICT checks fault flags | Safe |
| CF operations during reopen | YES - DB is closed, no ops possible | Safe |
Positive Observations
- The 4-mode verification design provides graduated strictness matching confidence levels.
- Using
Env::Default()for verification correctly avoids fault injection interference. - Warning-only for non-STRICT is appropriate given legitimate fallback scenarios.
- Plain
enumis consistent withLastIterateOpin the same class. - Lambda syntax in db_crashtest.py is consistent with other probabilistic options.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/code_review.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
|
This pull request has been merged in 88d7d2d. |
Summary:
This change enables testing of the two new MANIFEST optimization options introduced in D103568447:
Changes:
The verification logic handles 4 combinations:
Verification is warning-only (not fatal) to account for legitimate fallback cases like corruption or size limits.
Reviewed By: hx235
Differential Revision: D105224068