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

Manifests shrink when there are fewer chunk references #202

Merged
merged 2 commits into from
Oct 13, 2024
Merged

Conversation

paraseba
Copy link
Contributor

In the previous algorithm we were copying all chunks from the previous version to the new manifest (modulo changes in the current session).

Now, we only copy the chunks we need to copy. For example, after a clear operation, there will be 0 references in the manifest.

Most of the commit is moving code around to make it accessible from distributed_flush, that is, moving it from the Repository impl to free functions. The only important change happens in distributed_flush, where instead of starting from all the chunks in the previous manifest, we use the all_chunks iterator.

A new test verifies manifests shrink when we delete chunks or whole arrays.

Implements: #174

In the previous algorithm we were copying all chunks from the previous
version to the new manifest (modulo changes in the current session).

Now, we only copy the chunks we need to copy. For example, after a
`clear` operation, there will be 0 references in the manifest.

Most of the commit is moving code around to make it accessible from
`distributed_flush`, that is, moving it from the `Repository` impl to
free functions. The only important change happens in
`distributed_flush`, where instead of starting from all the chunks in
the previous manifest, we use the `all_chunks` iterator.

A new test verifies manifests shrink when we delete chunks or whole
arrays.

Implements: #174
@paraseba paraseba requested a review from mpiannucci October 13, 2024 02:18
pub fn chunks(&self) -> &BTreeMap<(NodeId, ChunkIndices), ChunkPayload> {
&self.chunks
}

pub fn size(&self) -> usize {
pub fn len(&self) -> usize {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@paraseba paraseba merged commit 651a697 into main Oct 13, 2024
2 checks passed
@paraseba paraseba deleted the seba/shrinking branch October 13, 2024 16:30
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.

2 participants