d7076778e2
This commit removes badger from the deal-making processes, and moves to a new architecture with the dagstore as the cental component on the miner-side, and CARv2s on the client-side. Every deal that has been handed off to the sealing subsystem becomes a shard in the dagstore. Shards are mounted via the LotusMount, which teaches the dagstore how to load the related piece when serving retrievals. When the miner starts the Lotus for the first time with this patch, we will perform a one-time migration of all active deals into the dagstore. This is a lightweight process, and it consists simply of registering the shards in the dagstore. Shards are backed by the unsealed copy of the piece. This is currently a CARv1. However, the dagstore keeps CARv2 indices for all pieces, so when it's time to acquire a shard to serve a retrieval, the unsealed CARv1 is joined with its index (safeguarded by the dagstore), to form a read-only blockstore, thus taking the place of the monolithic badger. Data transfers have been adjusted to interface directly with CARv2 files. On inbound transfers (client retrievals, miner storage deals), we stream the received data into a CARv2 ReadWrite blockstore. On outbound transfers (client storage deals, miner retrievals), we serve the data off a CARv2 ReadOnly blockstore. Client-side imports are managed by the refactored *imports.Manager component (when not using IPFS integration). Just like it before, we use the go-filestore library to avoid duplicating the data from the original file in the resulting UnixFS DAG (concretely the leaves). However, the target of those imports are what we call "ref-CARv2s": CARv2 files placed under the `$LOTUS_PATH/imports` directory, containing the intermediate nodes in full, and the leaves as positional references to the original file on disk. Client-side retrievals are placed into CARv2 files in the location: `$LOTUS_PATH/retrievals`. A new set of `Dagstore*` JSON-RPC operations and `lotus-miner dagstore` subcommands have been introduced on the miner-side to inspect and manage the dagstore. Despite moving to a CARv2-backed system, the IPFS integration has been respected, and it continues to be possible to make storage deals with data held in an IPFS node, and to perform retrievals directly into an IPFS node. NOTE: because the "staging" and "client" Badger blockstores are no longer used, existing imports on the client will be rendered useless. On startup, Lotus will enumerate all imports and print WARN statements on the log for each import that needs to be reimported. These log lines contain these messages: - import lacks carv2 path; import will not work; please reimport - import has missing/broken carv2; please reimport At the end, we will print a "sanity check completed" message indicating the count of imports found, and how many were deemed broken. Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com> Co-authored-by: Dirk McCormick <dirkmdev@gmail.com> Co-authored-by: Raúl Kripalani <raul@protocol.ai> Co-authored-by: Dirk McCormick <dirkmdev@gmail.com> |
||
---|---|---|
.. | ||
docs | ||
ffiwrapper | ||
fr32 | ||
fsutil | ||
mock | ||
partialfile | ||
sealtasks | ||
stores | ||
storiface | ||
tarutil | ||
cbor_gen.go | ||
faults.go | ||
manager_calltracker.go | ||
manager_test.go | ||
manager.go | ||
piece_provider_test.go | ||
piece_provider.go | ||
README.md | ||
request_queue_test.go | ||
request_queue.go | ||
resources.go | ||
roprov.go | ||
sched_resources.go | ||
sched_test.go | ||
sched_worker.go | ||
sched.go | ||
selector_alloc.go | ||
selector_existing.go | ||
selector_task.go | ||
stats.go | ||
teststorage_test.go | ||
testworker_test.go | ||
worker_calltracker.go | ||
worker_local.go | ||
worker_tracked.go |
sector-storage
a concrete implementation of the specs-storage interface
The sector-storage project provides a implementation-nonspecific reference implementation of the specs-storage interface.
Disclaimer
Please report your issues with regards to sector-storage at the lotus issue tracker
Architecture
Manager
Manages is the top-level piece of the storage system gluing all the other pieces together. It also implements scheduling logic.
package stores
This package implements the sector storage subsystem. Fundamentally the storage
is divided into path
s, each path has it's UUID, and stores a set of sector
'files'. There are currently 3 types of sector files - unsealed
, sealed
,
and cache
.
Paths can be shared between nodes by sharing the underlying filesystem.
stores.Local
The Local store implements SectorProvider for paths mounted in the local filesystem. Paths can be shared between nodes, and support shared filesystems such as NFS.
stores.Local implements all native filesystem-related operations
stores.Remote
The Remote store extends Local store, handles fetching sector files into a local store if needed, and handles removing sectors from non-local stores.
stores.Index
The Index is a singleton holding metadata about storage paths, and a mapping of sector files to paths
LocalWorker
LocalWorker implements the Worker interface with ffiwrapper.Sealer and a store.Store instance
License
The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)