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: FileMount should use url Path instead of Host #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

distractedm1nd
Copy link

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
Copy link
Member

raulk commented Apr 13, 2023

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
Copy link
Contributor

dirkmc commented Apr 13, 2023

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

mount/file.go Outdated
Comment on lines 47 to 48
if u.Path == "" {
return fmt.Errorf("invalid host")

Choose a reason for hiding this comment

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

Update error?

Copy link
Author

Choose a reason for hiding this comment

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

fixed

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.

4 participants