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: disable leveldb as LID default #1681

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions itests/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ func (f *TestFramework) Start(opts ...ConfigOpt) error {

cfg.Dealmaking.ExpectedSealDuration = 10

// Enable LID with leveldb
cfg.LocalIndexDirectory.Leveldb.Enabled = true

err = lr.SetConfig(func(raw interface{}) {
rcfg := raw.(*config.Boost)
*rcfg = *cfg
Expand Down
3 changes: 3 additions & 0 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func DefaultBoost() *Boost {
Yugabyte: LocalIndexDirectoryYugabyteConfig{
Enabled: false,
},
Leveldb: LocalIndexDirectoryLeveldbConfig{
Enabled: false,
},
ParallelAddIndexLimit: 4,
EmbeddedServicePort: 8042,
ServiceApiInfo: "",
Expand Down
14 changes: 14 additions & 0 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ type LocalIndexDirectoryYugabyteConfig struct {

type LocalIndexDirectoryConfig struct {
Yugabyte LocalIndexDirectoryYugabyteConfig
Leveldb LocalIndexDirectoryLeveldbConfig
// The maximum number of add index operations allowed to execute in parallel.
// The add index operation is executed when a new deal is created - it fetches
// the piece from the sealing subsystem, creates an index of where each block
Expand All @@ -416,3 +417,7 @@ type LocalIndexDirectoryConfig struct {
// The RPC timeout when making requests to the boostd-data service
ServiceRPCTimeout Duration
}

type LocalIndexDirectoryLeveldbConfig struct {
Enabled bool
}
8 changes: 7 additions & 1 deletion node/modules/piecedirectory.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewPieceDirectoryStore(cfg *config.Boost) func(lc fx.Lifecycle, r lotus_rep
migrator := yugabyte.NewMigrator(settings, address.Address(maddr))
bdsvc = svc.NewYugabyte(settings, migrator)

default:
case cfg.LocalIndexDirectory.Leveldb.Enabled:
log.Infow("local index directory: connecting to leveldb instance")

// Setup a local index directory service that connects to the leveldb
Expand All @@ -82,6 +82,12 @@ func NewPieceDirectoryStore(cfg *config.Boost) func(lc fx.Lifecycle, r lotus_rep
if err != nil {
return fmt.Errorf("creating leveldb local index directory: %w", err)
}

default:
return fmt.Errorf("starting local index directory client: " +
"neither yugabyte nor leveldb is enabled in config - " +
"you must explicitly configure either LocalIndexDirectory.Yugabyte "+
"or LocalIndexDirectory.Leveldb as the local index directory implementation")
}

// Start the embedded local index directory service
Expand Down