Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix OOM when restoring a Snapshot #9088

Merged
merged 1 commit into from
Jul 11, 2018
Merged

Fix OOM when restoring a Snapshot #9088

merged 1 commit into from
Jul 11, 2018

Conversation

ngotchac
Copy link
Contributor

Fixes #8825

The issue was that snapshot chunks were fetched at random, meaning that if an account would be divided into multiple chunks (because it was too big to fit in one), the extracted data would sit in memory until the last chunk of the account is fetched and processed; thus causing increasing memory usage until everything can be flushed in DB, and this would trigger an OOM.

This fix is thus quite simple : fetch the chunks in the right order.

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jul 10, 2018
@5chdn 5chdn added this to the 2.0 milestone Jul 10, 2018
@5chdn 5chdn added the P5-sometimesoon 🌲 Issue is worth doing soon. label Jul 10, 2018
@5chdn 5chdn requested review from debris and ordian July 10, 2018 17:46
Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Nice catch! Can confirm the peek is now gone (although the chunks are not guaranteed to come in the right order)
no_peek

@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 11, 2018
Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

lgtm

@5chdn 5chdn merged commit c082af6 into master Jul 11, 2018
@5chdn 5chdn deleted the ng-fix-snapshot-oom branch July 11, 2018 11:04
5chdn pushed a commit that referenced this pull request Jul 11, 2018
@5chdn 5chdn mentioned this pull request Jul 11, 2018
12 tasks
5chdn added a commit that referenced this pull request Jul 17, 2018
* parity-version: stabelize 1.11

* parity-version: bump stable to 1.11.7

* Don't fetch snapshot chunks at random (#9088)

* Offload cull to IoWorker.

* Limit the number of transactions in pending set (#8777)

* Unordered iterator.

* Use unordered and limited set if full not required.

* Split timeout work into smaller timers.

* Avoid collecting all pending transactions when mining

* Remove println.

* Use priority ordering in eth-filter.

* Fix ethcore-miner tests and tx propagation.

* Review grumbles addressed.

* Add test for unordered not populating the cache.

* Fix ethcore tests.

* Fix light tests.

* Fix ethcore-sync tests.

* Fix RPC tests.

* Make sure to produce full blocks.

* Update hidapi, fixes #7542 (#9108)

* docker: add cmake dependency (#9111)

* Fix miner tests.

* Revert "Make sure to produce full blocks."

This reverts commit b12d592.

* Update light client hardcoded headers (#9098)

* Insert Kovan hardcoded headers until #7690241

* Insert Kovan hardcoded headers until block 7690241

* Insert Ropsten hardcoded headers until #3612673

* Insert Mainnet hardcoded headers until block 5941249

* Make sure to produce full blocks. (#9115)

* Insert ETC (classic) hardcoded headers until block #6170625 (#9121)

* fix verification in ethcore-sync collect_blocks (#9135)

* `evm bench` fix broken dependencies (#9134)

* `evm bench` use valid dependencies

Benchmarks of the `evm` used stale versions of a couple a crates that
this commit fixes!

* fix warnings
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parity process killed when warp-syncing
4 participants