-
Notifications
You must be signed in to change notification settings - Fork 897
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
Bugfix snapshot transaction segfaults after storage truncation #4786
Bugfix snapshot transaction segfaults after storage truncation #4786
Conversation
50ee949
to
cf85130
Compare
9fd132a
to
8e8a72f
Compare
61169d0
to
8e8a72f
Compare
376705b
to
8558206
Compare
d2e0f82
to
f6cd5f8
Compare
we must check the impact on performance at the time of persistence because we are creating the snapshot at this time |
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiSnapshotWorldState.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/SnapshotTrieLogManager.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiSnapshotWorldState.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/hyperledger/besu/ethereum/bonsai/BonsaiWorldStateKeyValueStorage.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/SnapshotTrieLogManager.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/SnapshotTrieLogManager.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/bonsai/SnapshotTrieLogManager.java
Outdated
Show resolved
Hide resolved
I didn't see any performance impact on block processing time, after 3 hours of execution |
f6cd5f8
to
5a2d7d1
Compare
...creation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java
Show resolved
Hide resolved
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.
Approve performance overhead. This PR does not have an effect on block processing performance
4564c26
to
5d3a53a
Compare
9f48fba
to
8890a82
Compare
…napshot remove MutableWorldState parameter from saveTrieLog make addCachedLayer protected in AbstractTrieLogManager, remove from TrieLogManager interface Signed-off-by: garyschulte <garyschulte@gmail.com>
… KeyValue storage Signed-off-by: garyschulte <garyschulte@gmail.com>
… trie logs Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…ke clear and clearFlatDatabase and close as appropriate protect RocksDBSnapshotTransactions to prevent reading or writing to a closed transaction Signed-off-by: garyschulte <garyschulte@gmail.com>
…R the worldstate is committed. Signed-off-by: garyschulte <garyschulte@gmail.com>
…rsist() Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…BlockCreator Signed-off-by: garyschulte <garyschulte@gmail.com>
adds subscriptions to BonsaiPersistedWorldState use worldstate accessor in AbstractTrieLogManager rather than member persisted state cached snapshots subscribe to their respective worldstates prevent closing of snapshots unless subscriber count is 0 Signed-off-by: garyschulte <garyschulte@gmail.com>
…er than in the snapshot itself, so we can more easily handle truncate events Signed-off-by: garyschulte <garyschulte@gmail.com>
…ssertions Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
8890a82
to
f781b32
Compare
…ledger#4786) * subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults * fix for direct snapshot creation when using snapshot archive * ensure we only prune bonsai worldstates if we have more than the configured number of retained states Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
…ledger#4786) * subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults * fix for direct snapshot creation when using snapshot archive * ensure we only prune bonsai worldstates if we have more than the configured number of retained states Signed-off-by: garyschulte <garyschulte@gmail.com>
…ledger#4786) * subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults * fix for direct snapshot creation when using snapshot archive * ensure we only prune bonsai worldstates if we have more than the configured number of retained states Signed-off-by: garyschulte <garyschulte@gmail.com>
…ledger#4786) * subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults * fix for direct snapshot creation when using snapshot archive * ensure we only prune bonsai worldstates if we have more than the configured number of retained states Signed-off-by: garyschulte <garyschulte@gmail.com>
* Use safe block as pivot block suring snapsync (#4819) * Bugfix snapshot transaction segfaults after storage truncation (#4786) * Bugfix potential chain head and worldstate inconsistency (#4862) * Peering - disconnect worst peer (#4888) * Attempt to fix CPU spikes issue (#4867) * not block subscribe when the worldstate storage is open (#4912) Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net> Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
…ledger#4786) * subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults * fix for direct snapshot creation when using snapshot archive * ensure we only prune bonsai worldstates if we have more than the configured number of retained states Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
This PR addresses a race where snap and checkpoint syncs can cause a segfault when starting a worldstate download. The segfault occurs when rocksdb snapshot transactions are read/written after a storage truncation. To prevent this and to ensure future uses of clear() and clearFlatDatabase() cannot cause segfaults, this PR:
Additionally, only drop cached layers by distance from head when the worldstate archive has more than the configured number of retained layers.
Fixed Issue(s)
addresses #4765
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog