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

fix(client): fix trie_node_touched bug #3025

Merged
merged 5 commits into from
Jul 23, 2020
Merged

Conversation

mikhailOK
Copy link
Contributor

Add read snapshots to storage and do refactoring where
Trie instances are no longer persisted.

Fixes #3020

Test plan

existing tests

Add read snapshots to storage and do refactoring where
Trie instances are no longer persisted.

Test plan
---------
existing tests
@gitpod-io
Copy link

gitpod-io bot commented Jul 22, 2020

core/store/src/db.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@bowenwang1996 bowenwang1996 left a comment

Choose a reason for hiding this comment

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

Can we add a test that reproduces the failure and verify that it passes now?

core/store/src/trie/shard_tries.rs Outdated Show resolved Hide resolved
let mut guard = self.cache.lock().expect(POISONED_LOCK_ERR);
if let Some(val) = guard.cache_get(hash) {
Self::vec_to_rc(val)
// Ignore cache to be safe. retrieve_rc is used only when writing storage and cache is shared with readers.
Copy link
Collaborator

Choose a reason for hiding this comment

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

but don't we write to storage quite frequently (every block)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

most of the time retrieve_rc is called on new values, and we go to storage anyway

@evgenykuzyakov
Copy link
Collaborator

Is it possible to reproduce the panic from the linked issue within a test?

@mikhailOK mikhailOK merged commit 23c5a49 into master Jul 23, 2020
@mikhailOK mikhailOK deleted the fix_trie_nodes_touched branch July 23, 2020 00:33
bowenwang1996 pushed a commit that referenced this pull request Jul 23, 2020
Change some code so that Trie instances are no longer persisted.

Test plan
---------
existing tests, new regression test
bowenwang1996 pushed a commit that referenced this pull request Jul 28, 2020
Change some code so that Trie instances are no longer persisted.

Test plan
---------
existing tests, new regression test
@@ -226,6 +227,7 @@ impl DBTransaction {
pub struct RocksDB {
db: DB,
cfs: Vec<*const ColumnFamily>,
_pin: PhantomPinned,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's was the intention of pining related changes here (adding PhantomPinned and Pin<dyn ...>)? On the first glance, it seems as if they don't do anything useful here.

Copy link
Member

Choose a reason for hiding this comment

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

cc @bowenwang1996

I'm simply worried that we mention such change the second time in two weeks. First was #5722.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure 😅

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.

Error in trie_node_touched
6 participants