Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer serialize small indexes to disk #4270

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

SirTyson
Copy link
Contributor

@SirTyson SirTyson commented Apr 3, 2024

Description

Resolves #4268

Previously, we serialized every BucketListDB index to disk, regardless of size. This created significant disk churn in small, top level buckets, where new indexes are being re-written constantly.

This change no longer serializes the IndividualIndex type to disk to reduce this churn. By default, all buckets with size < 20 MB have individual indexes, so this will remove disk churn on the small, top most buckets. This also removes writing indexes to disk on the main thread, as previously Bucket::addBatch needed to write indexes to disk as part of ledgerClose.

There are essentially no drawbacks to recreating individual indexes on startup. They are so small that recreating them takes about as long as deserializing them. This change adds approximately 100ms to node startup time.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copy link
Contributor

@dmkozh dmkozh left a comment

Choose a reason for hiding this comment

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

LGTM, let's merge after we unfreeze Core

@dmkozh
Copy link
Contributor

dmkozh commented Apr 18, 2024

r+ 66675ae

@latobarita latobarita merged commit 07a1f55 into stellar:master Apr 18, 2024
15 checks passed
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.

Stop Persisting Individual Indexes on BucketListDB
4 participants