filecoin-project / dagstore

a sharded store to hold large IPLD graphs efficiently, packaged as location-transparent attachable CAR files, with mechanical sympathy
Other
42 stars 24 forks source link

fix: `FileMount` should use url `Path` instead of `Host` #157

Open distractedm1nd opened 1 year ago

distractedm1nd commented 1 year ago

We encountered a bug recently after switching from FSMount to FileMount.

The root cause of the problem was the usage of the Host field of url.URL to store the file path. This led to incorrect URL encoding, which caused the application to fail when trying to recover the state of shards.

Should we add backwards compatibility to the Deserialize method so that mounts previously Serialized() using Host will be loaded correctly?

raulk commented 1 year ago

Great find! The most correct way to handle the change would be to perform a shard store migration. @nonsense @dirkmc I don't suppose we've encountered this issue in Boost or lotus-miner since we use a Filecoin-specific mount type?

dirkmc commented 1 year ago

Yes, as you say we haven't come across this issue because we use a specific mount type