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

Provide storage miner with configurable path for offline deal data when staging for sealing. #5291

Closed
f8-ptrk opened this issue Jan 5, 2021 · 6 comments · Fixed by #6853
Closed
Assignees

Comments

@f8-ptrk
Copy link
Contributor

f8-ptrk commented Jan 5, 2021

Issue1: When importing data for an offline deal the fstmp files are placed directly in the LOTUS_MINER_PATH (possibly in a sealing folder, not sure - but for sure not in a subfolder) folder. that robs miners of the possibility to organize offline deals well.

Issue2: the fstmp filenames are not useful.

To Reproduce
Steps to reproduce the behavior:

  1. Run 'lotus-miner storage-deals import-data someCID /path/to/import/data.car'
  2. See LOTUS_MINER_PATH

Expected behavior
The files in a folder one could link another disk/partition/location to. Files with a name connected to the deal/imported file-name

Version (run lotus version):
Daemon: 1.4.0+git.e9989d0e4+api1.0.0
Local: lotus-miner version 1.4.0+git.e9989d0e4

Additional context
Nothing critical...

@dirkmc dirkmc added area/markets Area: Markets kind/feature Kind: Feature labels Jan 5, 2021
@s0nik42
Copy link

s0nik42 commented Jan 11, 2021

Can these files being removed safely ?

@f8-ptrk
Copy link
Contributor Author

f8-ptrk commented Jan 12, 2021

@s0nik42 they should get removed as soon as the deal goes to Active. knowledge i gathered just from watching terminal windows while sealing offline deals - nothing 100% sure

@frrist
Copy link
Member

frrist commented Jul 21, 2021

Exploring this code for the first time, going to leave some bread crumbs for anyone else interested in following along as I suspect some thoughtful design decisions will need to be made before proceeding with a solution.

  1. The lotus-storage-miner has a single repo that is initialized in the location specified by LOTUS_MINER_PATH(code)

  2. When the storage miner is instructed to run, a storage miner node is instantiated using the aforementioned repo (code)

  3. If the default storage miner config values are used, then the storage miner will instantiate a Market's Subsystem via dependency injection. As part of this instantiation a StoreageProvider is created (code)

  4. The StorageProvider accepts a LockedRepo as one of its params. The repo injected here will be the same repo the storage miner was instantiated with in step 2. (code)

  5. During the StorageProvider initilzation a FileStore is created.

A FileStore is used for storing temporary file data when handing off a deal to the Storage Miner. Once the Storage Miner reads a file from the FileStore and seals them into a sector the files are removed from the FileStore.

  • A FileStore accepts a file system path as its only initialization param. The path passed to the FileStore is the path of the Repo created in step 2 (code). This is where the problem described in the OP lies

The first ask here is to provide miner operators with the ability to configure their miners to use a path that is different than LOTUS_MINER_PATH. This will require code changes in Lotus.

The second ask is for the storage provider to create more informative names. This will require code changes in go-fil-markets and I have filed filecoin-project/go-fil-markets#583 to address this.

Some related issues:
#4901
#5591
#5569
#6130

@frrist frrist changed the title Prune unnecessary fstmp files created during importing data for offline deals Provide storage miner with configurable path for offline deal data when staging for sealing. Jul 21, 2021
@f8-ptrk
Copy link
Contributor Author

f8-ptrk commented Jul 21, 2021

The first ask here is to provide miner operators with the ability to configure their miners to use a path that is different than LOTUS_MINER_PATH. This will require code changes in Lotus.

a subfolder in the LOTUS_MINER_PATH would be enough. doesn't need to be configurable - folders can just be linked to that location and the requirements of "using another location" would be fulfilled

@frrist
Copy link
Member

frrist commented Jul 21, 2021

That's a much simpler change than the one I initially described. If that meets your needs, I will go with the simpler (subfolder) implementation instead.

@f8-ptrk
Copy link
Contributor Author

f8-ptrk commented Jul 21, 2021

it's not user friendly but at least reverts the current logic of how to achieve this

putting LOTUS_MINER_PATH on the target for the fstmp files and then link the rest of the miner into that folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants