-
Notifications
You must be signed in to change notification settings - Fork 112
feat(buffer): Disable flush-to-disk for ephemeral storage #5751
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,8 +43,8 @@ impl PolymorphicEnvelopeBuffer { | |
| /// Returns true if the implementation stores all envelopes in RAM. | ||
| pub fn is_memory(&self) -> bool { | ||
| match self { | ||
| PolymorphicEnvelopeBuffer::InMemory(_) => true, | ||
| PolymorphicEnvelopeBuffer::Sqlite(_) => false, | ||
| Self::InMemory(_) => true, | ||
| Self::Sqlite(_) => false, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -183,13 +183,16 @@ impl PolymorphicEnvelopeBuffer { | |
| // Currently, we want to flush the buffer only for disk, since the in memory implementation | ||
| // tries to not do anything and pop as many elements as possible within the shutdown | ||
| // timeout. | ||
| let Self::Sqlite(buffer) = self else { | ||
| relay_log::trace!("PolymorphicEnvelopeBuffer: shutdown procedure not needed"); | ||
| return false; | ||
| }; | ||
| buffer.flush().await; | ||
|
|
||
| true | ||
| match self { | ||
| Self::Sqlite(buffer) if !buffer.stack_provider.ephemeral() => { | ||
| buffer.flush().await; | ||
| true | ||
| } | ||
| _ => { | ||
| relay_log::trace!("shutdown procedure not needed"); | ||
| false | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ephemeral SQLite blocked by memory backpressure during shutdownMedium Severity When an ephemeral SQLite buffer returns
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is intended behavior. The memory implementation bypasses the memory check because it would otherwise get stuck -- it cannot lower memory pressure without unspooling & processing envelopes. The disk spooler, even the ephemeral one, can lower memory pressure by pausing the dequeue. |
||
| } | ||
|
|
||
| /// Returns the partition tag for this [`PolymorphicEnvelopeBuffer`]. | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.