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

Add in support for segmented binary stream snapshots. #4284

Merged
merged 1 commit into from Jul 5, 2023

Conversation

derekcollison
Copy link
Member

Streams with many interior deletes was causing issues due to the fact that the interior deletes were represented as a sorted []uint64. This could cause snapshots for streams R>1 and with lots of interior deletes to take up more memory and cpu then we want.

This new approach introduces 3 sub types of delete blocks, an avl bitmask tree, a run length encoding, and the legacy format above. We also take into account large interior deletes such that on receiving a snapshot we can skip things we already know about.

Signed-off-by: Derek Collison derek@nats.io

@derekcollison derekcollison requested a review from a team as a code owner July 1, 2023 06:13
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM!

server/events.go Outdated Show resolved Hide resolved
server/avl/seqset.go Outdated Show resolved Hide resolved
server/events.go Outdated Show resolved Hide resolved
server/events.go Outdated Show resolved Hide resolved
Streams with many interior deletes was causing issues due to the fact that the interior deletes were represented as a sorted []uint64.
This approach introduces 3 sub types of delete blocks, avl bitmask tree, a run length encoding, and the legacy format above.
We also take into account large interior deletes such that on receiving a snapshot we can skip things we already know about.

Signed-off-by: Derek Collison <derek@nats.io>
@derekcollison
Copy link
Member Author

I squashed the commits, good to merge?

@derekcollison derekcollison merged commit a393653 into dev Jul 5, 2023
2 checks passed
@derekcollison derekcollison deleted the binary-stream-snapshot branch July 5, 2023 16:17
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.

None yet

3 participants