Skip to content

feat(replay): Avoid StoreEnvelope in forward_store#5625

Open
tobias-wilfert wants to merge 9 commits intomasterfrom
tobias-wilfert/feat/improve-store-forward-for-replays
Open

feat(replay): Avoid StoreEnvelope in forward_store#5625
tobias-wilfert wants to merge 9 commits intomasterfrom
tobias-wilfert/feat/improve-store-forward-for-replays

Conversation

@tobias-wilfert
Copy link
Member

@tobias-wilfert tobias-wilfert commented Feb 10, 2026

This changes the forward_store for the replay processor to not use StoreEnvelope and instead directly send typed messages to the store (which avoids unnecessary conversions).
As part of that it moves the validation logic out of the store such that only logic left is some simple mapping.

Follow up to: #5580

@tobias-wilfert tobias-wilfert marked this pull request as ready for review February 10, 2026 14:27
@tobias-wilfert tobias-wilfert requested a review from a team as a code owner February 10, 2026 14:27
@linear
Copy link

linear bot commented Feb 12, 2026

Comment on lines +38 to +48
// Size of the consumer message. We can be reasonably sure this won't overflow because
// of the request size validation provided by Nginx and Relay.
let mut payload_size = MESSAGE_METADATA_OVERHEAD;
payload_size += event.as_ref().map_or(0, |b| b.len());
payload_size += video.as_ref().map_or(0, |b| b.len());
payload_size += recording.len();

if payload_size >= ctx.max_replay_message_size {
relay_log::debug!("replay_recording over maximum size.");
return Err(Error::TooLarge);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Validation copied from the store.

@tobias-wilfert
Copy link
Member Author

tobias-wilfert commented Feb 12, 2026

The logic in this PR has changed quite a bit as it was started before we stopped sending ReplayEventKafkaMessage (#5629) and when we still allowed for standalone replay_events (#5634). So only looking at the final state rather than the individual commits might be easier.

@tobias-wilfert tobias-wilfert requested review from a team, Dav1dde and jjbayer February 12, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants