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

feat: argument based prefetcher #7620

Merged
merged 54 commits into from
Sep 15, 2022

Conversation

jakmeier
Copy link
Contributor

Prefetcher that loads IO requests in parallel if the keys are listed in the smart contract function call argument.

This is a experimental feature that has proven to stabilize mainnet nodes under current traffic. Especially when the node is not running with fast local SSDs.

In the future we should generalize this implementation.

jakmeier and others added 30 commits August 30, 2022 16:46
Standard rocksdb `flush()` only flushes the default column family.
See https://github.com/facebook/rocksdb/blob/95ef007adc9365fbefc0f957722a191c1fd7dcd3/include/rocksdb/db.h#L1398-L1400

To flush all column families as intended, iterator over them and flush
them individually.
Co-authored-by: Léo Gaspard <github@leo.gaspard.ninja>
- use crossbeam `ArrayQueue`
    - this also fixes wrong usage of `BoundedQueue`
- put arc and mutex inside `PrefetchStagingArea`
- fixed false comments
- by default have prefetching disabled, allow enabling it with config
- keep prefetcher and IO threads alive between chunks
- use crossbeam bounded channel
- remove stop_io atomic boolean
- change some comments
- comments
- avoid double lock of same mutex
- handle prefetcher errors more gracefully
general prefetch was swapped with receipt prefetch
@jakmeier jakmeier requested a review from a team as a code owner September 15, 2022 10:24
core/store/src/trie/prefetching_trie_storage.rs Outdated Show resolved Hide resolved
runtime/runtime/src/prefetch.rs Show resolved Hide resolved
core/store/src/metrics.rs Outdated Show resolved Hide resolved
core/store/src/metrics.rs Outdated Show resolved Hide resolved
core/store/src/metrics.rs Outdated Show resolved Hide resolved
core/store/src/trie/shard_tries.rs Outdated Show resolved Hide resolved
runtime/runtime/src/prefetch.rs Outdated Show resolved Hide resolved
jakmeier and others added 8 commits September 15, 2022 15:01
- add comment about hack and when to remove it
- call `slots.update_metrics()` in constructor
Co-authored-by: Ekleog-NEAR <96595974+Ekleog-NEAR@users.noreply.github.com>
Co-authored-by: Ekleog-NEAR <96595974+Ekleog-NEAR@users.noreply.github.com>
Co-authored-by: Ekleog-NEAR <96595974+Ekleog-NEAR@users.noreply.github.com>
Co-authored-by: Ekleog-NEAR <96595974+Ekleog-NEAR@users.noreply.github.com>
@near-bulldozer near-bulldozer bot merged commit 36feba3 into near:master Sep 15, 2022
jakmeier added a commit to jakmeier/nearcore that referenced this pull request Sep 15, 2022
Prefetcher that loads IO requests in parallel if the keys are listed in the  smart contract function call argument.

This is a experimental feature that has proven to stabilize mainnet nodes under current traffic. Especially when the node is not running with fast local SSDs.

In the future we should generalize this implementation.
nikurt pushed a commit that referenced this pull request Nov 9, 2022
Prefetcher that loads IO requests in parallel if the keys are listed in the  smart contract function call argument.

This is a experimental feature that has proven to stabilize mainnet nodes under current traffic. Especially when the node is not running with fast local SSDs.

In the future we should generalize this implementation.
@jakmeier jakmeier deleted the prefetch-sweat-ready-for-master branch November 22, 2022 14: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.

4 participants