Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 15, 2022

Storing a set of seen CIDs to short-cut DAG traversal while ensuring we have all the blocks in a DAG in the blockstore can cause OOMs for very large DAGs so replace the unbounded Set with a LRU cache with a configurable maximum size.

Storing a set of seen CIDs to short-cut DAG traversal while ensuring
we have all the blocks in a DAG in the blockstore can cause OOMs for
very large DAGs.
@BigLep
Copy link

BigLep commented Sep 15, 2022

How easy is it to add a regression test?

@achingbrain
Copy link
Member Author

achingbrain commented Sep 16, 2022

I'm removing an optimisation that doesn't appear to have had a specific test for it - I should really be deleting a test here..

The optimisation is now retained but we use a LRU cache instead of an unbounded Set.

Refactor to use a lru cache instead of an unbounded set and add a
test to make sure the cache actually caches things.
@achingbrain achingbrain merged commit 336d0b9 into master Sep 21, 2022
@achingbrain achingbrain deleted the fix/oom-in-dag-traversal branch September 21, 2022 16:30
github-actions bot pushed a commit that referenced this pull request Sep 21, 2022
## [ipfs-repo-migrations-v13.0.3](ipfs-repo-migrations-v13.0.2...ipfs-repo-migrations-v13.0.3) (2022-09-21)

### Bug Fixes

* OOM on large DAGs ([#410](#410)) ([336d0b9](336d0b9))

### Dependencies

* update @multiformats/multiaddr to 11.0.0 ([#411](#411)) ([f7b34eb](f7b34eb))
@github-actions
Copy link

πŸŽ‰ This PR is included in version ipfs-repo-migrations-v13.0.3 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Sep 21, 2022
## [ipfs-repo-v15.0.3](ipfs-repo-v15.0.2...ipfs-repo-v15.0.3) (2022-09-21)

### Bug Fixes

* OOM on large DAGs ([#410](#410)) ([336d0b9](336d0b9))
@github-actions
Copy link

πŸŽ‰ This PR is included in version ipfs-repo-v15.0.3 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants