Skip to content

fix(dursto): open databases read-only when checking out#1089

Merged
victor-dumitrescu merged 1 commit into
mainfrom
vdum/checkout_db_read_only
Jun 9, 2026
Merged

fix(dursto): open databases read-only when checking out#1089
victor-dumitrescu merged 1 commit into
mainfrom
vdum/checkout_db_read_only

Conversation

@victor-dumitrescu

@victor-dumitrescu victor-dumitrescu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Relates to RV-984

What

Opens RocksDB databases as read-only when checking out.

Why

Stumbled upon this while trying to diagnose an issue with the long tests (#1084) where I noticed that the size of a commit is (surprisingly) correlated to the the number of proptest cases executed. This happens because every test case starts with a checkout, which, in read-write mode, will result in a new LOG file, with the previous log file stored asLOG.old.XXXX. This balloons the size of a commit from ~1.5 MiB for 10 test cases to ~22 MiB for 256 test cases. With this fix, the initial commit drops to 0.24 MiB.

How

By using open_cf_descriptors_read_only instead of open_cf_descriptors for checking out.

An alternative fix would have been to limit the number of log files that are kept using set_keep_log_file_num. We could fall back on it if there's a good reason to keep opening DBs in read-write mode.

Manually Testing

make all

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@victor-dumitrescu victor-dumitrescu marked this pull request as ready for review June 9, 2026 12:38
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Benchmark results for revision 50c4db4:

Metric Duration TPS
Mean 1.469153385s 27.227
Worst 1.495357675s 26.749
Best 1.461093996s 27.377
Standard Deviation ±7.13852ms ±0.131
Full results
Run Transfers Duration TPS
1 40 1.495357675s 26.749
2 40 1.469156373s 27.227
3 40 1.471735669s 27.179
4 40 1.469755949s 27.215
5 40 1.474529408s 27.127
6 40 1.470110972s 27.209
7 40 1.472418872s 27.166
8 40 1.461682638s 27.366
9 40 1.462207625s 27.356
10 40 1.469265796s 27.224
11 40 1.468918769s 27.231
12 40 1.465177772s 27.300
13 40 1.461093996s 27.377
14 40 1.463393889s 27.334
15 40 1.468697464s 27.235
16 40 1.464140267s 27.320
17 40 1.473601017s 27.144
18 40 1.468084585s 27.246
19 40 1.464606573s 27.311
20 40 1.46913239s 27.227

Compare the results above with those for the default branch.

@emturner emturner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came across this yesterday too! But this time in the context of the file-handles investigation.

The diff is identical to the one I hadn't pushed yet 😅 so LGTM

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.19%. Comparing base (e8d4cce) to head (0b2db40).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1089      +/-   ##
==========================================
+ Coverage   90.16%   90.19%   +0.02%     
==========================================
  Files         130      130              
  Lines       28391    28394       +3     
  Branches    28391    28394       +3     
==========================================
+ Hits        25599    25609      +10     
+ Misses       2027     2020       -7     
  Partials      765      765              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@victor-dumitrescu victor-dumitrescu added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit acb364f Jun 9, 2026
11 checks passed
@victor-dumitrescu victor-dumitrescu deleted the vdum/checkout_db_read_only branch June 9, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants