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

feat(replays): lower max replay recording segment size to 10 MiB #2031

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

JoshFerge
Copy link
Member

  • Update the config to include two separate values for maximum replay size: one for compressed size (called max_replay_compressed) and one for uncompressed size max_replay_uncompressed_size. The original value now represents the uncompressed size (100 MiB), which is utilized during processing. The new value, max_replay_compressed, is applied during the ingest stage.
  • Replays formerly relied on the maximum attachment limit of 100 MiB. Now, they use the new max_replay_compressed_size (10 MiB) setting for check_envelope_size_limits.

We are making this change as we have done analysis around our payload sizes, and if replays are above this size there is usually something off with them (mass mutation bugs, accidental inclusion of files, old SDK versions, etc.)

@JoshFerge JoshFerge requested review from a team April 13, 2023 18:07
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

RSLGTM!

Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

I left few questions, before approving this.

Also you like to get @jjbayer opinion on the naming here.

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -542,8 +542,10 @@ struct Limits {
max_api_chunk_upload_size: ByteSize,
/// The maximum payload size for a profile
max_profile_size: ByteSize,
/// The maximum payload size for a replay.
max_replay_size: ByteSize,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we keep old config and use max_replay_size as incoming check, the one is currently called max_replay_compressed_size, which clearly signals what the check is for, and if this is really necessary also use serde alias to rename it to the new name?

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

The new naming looks OK to me, but I would add the old name as an alias as @olksdr suggests, such that this is not a breaking change.

relay-config/src/config.rs Outdated Show resolved Hide resolved
@jjbayer jjbayer self-assigned this Apr 17, 2023
@@ -542,8 +542,10 @@ struct Limits {
max_api_chunk_upload_size: ByteSize,
/// The maximum payload size for a profile
max_profile_size: ByteSize,
/// The maximum payload size for a replay.
max_replay_size: ByteSize,
Copy link
Member

Choose a reason for hiding this comment

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

The new naming looks OK to me, but I would add the old name as an alias as @olksdr suggests, such that this is not a breaking change.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@jjbayer jjbayer removed their assignment Apr 17, 2023
@JoshFerge JoshFerge requested review from olksdr and jjbayer April 18, 2023 01:42
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

Once the changelog updated , this should be good to go.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

See @olksdr 's changelog comments, otherwise LGTM!

@JoshFerge
Copy link
Member Author

@bmckerry has increased the max message size of our kafka topic, this and #2032 should be good to go! can merge once approved. can deploy this one first, then 2032 subsequently.

@JoshFerge JoshFerge merged commit a2e9a82 into master Apr 19, 2023
@JoshFerge JoshFerge deleted the jferg/lower-max-replay-limit branch April 19, 2023 17:11
JoshFerge added a commit that referenced this pull request Apr 20, 2023
We were previously chunking kafka messages on the replay recording topic
to 1 MiB. We are aiming to eliminate this chunking as it requires us to
maintain a redis cluster / constrains us to in-order processing. Other
infra at Sentry has successfully experimented with larger kafka
messages, so we feel this is safe.

With #2031 this should pretty
much mean we no longer chunk any messages. We can remove the chunking
logic once this is confirmed after deploy.

- [x] Increase chunking limit from 1MiB to 15 MiB. 

We chose 15MiB as the limit, as we're eventually going to combine the
replay event with the replay recording, and will want some extra
headroom for this in addition to our 10 MiB recording limit.

Depends on ops increasing our kafka payload size limit first.
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.

4 participants