-
Couldn't load subscription status.
- Fork 104
fix(spooler): Reduce number of disk reads #3983
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
Conversation
| // On the other hand, if we are recreating a stack, it means that we popped it because | ||
| // it was empty, or we never had data on disk for that stack, so we assume by default | ||
| // that there is no need to check disk until some data is spooled. | ||
| matches!(stack_creation_type, StackCreationType::Initialization), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we move this to a helper function assume_data_on_disk(stack_creation_type) to clarify intent? The code comment can then be a doc comment on that function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, will do!
| /// Pushes a new [`EnvelopeStack`] with the given [`Envelope`] inserted. | ||
| async fn push_stack( | ||
| &mut self, | ||
| stack_creation_type: StackCreationType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make StackCreationType an enum with data and remove project_key_pair and envelope parameters, something like
enum StackOrigin {
Existing(ProjectKeyPair),
NewEnvelope(Box<Envelope>),
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is a confusing enumerator since it doesn't depict what is going on. I would rather always create an empty stack and specify the context in which it is created.
* master: (27 commits) build: Update dialoguer and hostname (#4009) build: Update opentelemetry-proto to 0.7.0 (#4000) build: Update lru to 0.12.4 (#4008) build: Update cookie to 0.18.1 (#4007) feat(spans): Extract standalone CLS span metrics and performance score (#3988) build: Update cadence to 1.4.0 and statsdproxy to 0.2.0 (#4005) build: Update maxminddb to 0.24.0 (#4003) build: Update multer to 3.1.0 (#4002) build: Update regex and aho-corasick (#4001) build: Update sentry-kafka-schemas to 1.0.107 (#3999) build: Update dev-dependencies (#3998) build: Update itertools to 0.13.0 (#3993) build: Update brotli, zstd, flate2 (#3996) build: Update rdkafka to 0.36.2 (#3995) build: Update tikv-jemallocator to 0.6.0 (#3994) build: Update minidump to 0.22.0 (#3992) build: Update bindgen to 0.70.1 (#3991) build: Update chrono to 0.4.38 (#3990) feat(spans): initial MongoDB description scrubbing support (#3912) fix(spooler): Reduce number of disk reads (#3983) ...
This PR improves the spooler by reducing the number of disk reads by inferring when disk should be read and when it's not needed because we know for a fact that there isn't data on disk.
This whole implementation relies on the assumption that the data in the database is modified exclusively from the
EnvelopeStackwith given project key pairs.Closes: https://github.com/getsentry/team-ingest/issues/532
#skip-changelog