holochain / holochain-rust

DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.
GNU General Public License v3.0
1.12k stars 267 forks source link

On restart of a persisted instance, getting "Failed to load instance test-instance from storage: DnaMissing" #1768

Open Connoropolous opened 5 years ago

Connoropolous commented 5 years ago

Then it goes to Initializing new chain...

I might be missing something, but I think this is a bug wherein you can't actually reload a whole chain from storage :s

Connoropolous commented 5 years ago

I think the problem is that it doesn't exit when it encounters this kind of error... https://github.com/holochain/holochain-rust/blob/d83246669ba565ce659cb036a5353ab1fae96d02/conductor_api/src/conductor/base.rs#L880-L888

Connoropolous commented 5 years ago

@lucksus @AshantiMutinta @zippy can you provide thoughts on this?

Connoropolous commented 5 years ago

In general this makes sense cause I hear that it doesn't actually write the DNA into storage

jamesray1 commented 5 years ago

May you please add more repro steps? I agree it looks like unexpected behaviour; on restarting a persisted instance you would expect "Successfully loaded instance test-instance from storage". Maybe could try to debug/check the storage path after Holochain::load(context.clone()).

I found this: https://github.com/holochain/holochain-rust/blob/a5ad16c576017d2baadc9cfe7fef1624836ae427/crates/core/src/persister.rs#L21-L29

Then for further reference:

https://stebalien.github.io/snowflake/snowflake/ "Process unique IDs are guaranteed to be unique within the current process, for the lifetime of the current process."

Link to #203.

Ping @thedavidmeister in case you want to add anything?

thedavidmeister commented 5 years ago

@jamesray1 yes you couldn't safely save any state that is only unique to a given process (e.g. as opposed to UUIDs) - that said i haven't looked around to see if there are still snowflakes in the state (those comments are pretty old)

jamesray1 commented 5 years ago

@thedavidmeister LTM like there are still snowflakes, e.g.:

In the network state:

https://github.com/holochain/holochain-rust/blob/aa53657ee25bd35304c177a8d5560318644b0ccf/crates/core/src/network/state.rs#L68

In ActionWrapper

https://github.com/holochain/holochain-rust/blob/master/crates/core/src/action.rs#L40-L55

etc: https://github.com/holochain/holochain-rust/search?q=snowflake&unscoped_q=snowflake

thedavidmeister commented 5 years ago

ok, if these are being saved/loaded it makes sense to me to use UUIDs instead