holochain-rust icon indicating copy to clipboard operation
holochain-rust copied to clipboard

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

Open Connoropolous opened this issue 6 years ago • 7 comments

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 avatar Oct 16 '19 19:10 Connoropolous

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 avatar Oct 16 '19 19:10 Connoropolous

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

Connoropolous avatar Oct 16 '19 19:10 Connoropolous

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

Connoropolous avatar Oct 16 '19 19:10 Connoropolous

~~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?

jamesray1 avatar Nov 12 '19 06:11 jamesray1

@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)

thedavidmeister avatar Nov 13 '19 08:11 thedavidmeister

@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

jamesray1 avatar Nov 15 '19 01:11 jamesray1

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

thedavidmeister avatar Nov 19 '19 12:11 thedavidmeister