Skip to content

Commit

Permalink
Set MORE defaults to more reasonable values
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed May 16, 2024
1 parent b5d6e72 commit 1e10e2b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions chain/consensus/filcns/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
_ "embed"
"fmt"
"os"
"runtime"
"strconv"
"time"

Expand Down Expand Up @@ -72,7 +71,7 @@ var (

func init() {
// the default calculation used for migration worker count
MigrationMaxWorkerCount = runtime.NumCPU()
MigrationMaxWorkerCount = 8
// check if an alternative value was request by environment
if mwcs := os.Getenv(EnvMigrationMaxWorkerCount); mwcs != "" {
mwc, err := strconv.ParseInt(mwcs, 10, 32)
Expand Down
2 changes: 1 addition & 1 deletion chain/stmgr/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func runPreMigration(ctx context.Context, sm *StateManager, fn PreMigrationFunc,
height := ts.Height()
parent := ts.ParentState()

if disabled := os.Getenv(EnvDisablePreMigrations); strings.TrimSpace(disabled) == "1" {
if val, isSet := os.LookupEnv(EnvDisablePreMigrations); !isSet || strings.TrimSpace(val) != "0" {
log.Warnw("SKIPPING pre-migration", "height", height)
return
}
Expand Down
3 changes: 3 additions & 0 deletions chain/stmgr/forks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) {
func TestForkPreMigration(t *testing.T) {
//stm: @CHAIN_GEN_NEXT_TIPSET_001,
//stm: @CHAIN_STATE_RESOLVE_TO_KEY_ADDR_001, @CHAIN_STATE_SET_VM_CONSTRUCTOR_001
if err := os.Setenv("LOTUS_DISABLE_PRE_MIGRATIONS", "0"); err != nil {
t.Fatalf("failed to force LOTUS_DISABLE_PRE_MIGRATIONS: %v", err)
}
logging.SetAllLoggers(logging.LevelInfo)

cg, err := gen.NewGenerator()
Expand Down
4 changes: 2 additions & 2 deletions documentation/en/default-lotus-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
[Chainstore]
# type: bool
# env var: LOTUS_CHAINSTORE_ENABLESPLITSTORE
EnableSplitstore = true
EnableSplitstore = false

[Chainstore.Splitstore]
# ColdStoreType specifies the type of the coldstore.
Expand Down Expand Up @@ -212,7 +212,7 @@
#
# type: uint64
# env var: LOTUS_CHAINSTORE_SPLITSTORE_HOTSTOREFULLGCFREQUENCY
#HotStoreFullGCFrequency = 20
#HotStoreFullGCFrequency = 1

# HotStoreMaxSpaceTarget sets a target max disk size for the hotstore. Splitstore GC
# will run moving GC if disk utilization gets within a threshold (150 GB) of the target.
Expand Down
4 changes: 2 additions & 2 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func DefaultFullNode() *FullNode {
SimultaneousTransfersForRetrieval: DefaultSimultaneousTransfers,
},
Chainstore: Chainstore{
EnableSplitstore: true,
EnableSplitstore: false,
Splitstore: Splitstore{
ColdStoreType: "discard",
HotStoreType: "badger",
MarkSetType: "badger",

HotStoreFullGCFrequency: 20,
HotStoreFullGCFrequency: 1,
HotStoreMaxSpaceTarget: 650_000_000_000,
HotStoreMaxSpaceThreshold: 150_000_000_000,
HotstoreMaxSpaceSafetyBuffer: 50_000_000_000,
Expand Down
2 changes: 1 addition & 1 deletion node/modules/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func MemoryConstraints() system.MemoryConstraints {
// MemoryWatchdog starts the memory watchdog, applying the computed resource
// constraints.
func MemoryWatchdog(lr repo.LockedRepo, lc fx.Lifecycle, constraints system.MemoryConstraints) {
if os.Getenv(EnvWatchdogDisabled) == "1" {
if val, isSet := os.LookupEnv(EnvWatchdogDisabled); !isSet || val != "0" {
log.Infof("memory watchdog is disabled via %s", EnvWatchdogDisabled)
return
}
Expand Down

0 comments on commit 1e10e2b

Please sign in to comment.