-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Denser in-memory representation of ShardBlobsToDelete
#109848
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
Denser in-memory representation of ShardBlobsToDelete
#109848
Conversation
Today each blob to be deleted at the end of a snapshot delete costs us ~80B of heap, and sometimes that can add up to GiBs of temporary heap usage in total. This commit changes the in-memory representation to use a compressed stream of pure bytes, which should be more than 4x denser. Partially mitigates elastic#108278
Pinging @elastic/es-distributed (Team:Distributed) |
Hi @DaveCTurner, I've created a changelog YAML for you. |
This comment was marked as outdated.
This comment was marked as outdated.
…ed-ShardBlobsToDelete
shardDeleteResults.add(new ShardSnapshotMetaDeleteResult(indexId, shardId, newGeneration, blobsToDelete)); | ||
try { | ||
shardGenerationsBuilder.put(indexId, shardId, newGeneration); | ||
new ShardSnapshotMetaDeleteResult(Objects.requireNonNull(indexId.getId()), shardId, blobsToDelete).writeTo(compressed); |
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.
As far as I understand blobsToDelete is already occupy memory we want to optimize. Adding in-memory compression will temporary increase heap usage by 20%? How do you know that blobsToDelete will be GC-ed after compression?
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.
There's nothing else retaining it apart from the reference in ShardBlobsToDelete#shardDeleteResults
.
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.
Nice! LGTM.
Today each blob to be deleted at the end of a snapshot delete costs us
~80B of heap, and sometimes that can add up to GiBs of temporary heap
usage in total. This commit changes the in-memory representation to use
a compressed stream of pure bytes, which should be more than 4x denser.
Partially mitigates #108278