From d2de85e481011c3ef0ef81d9e30cdd3f6a4f5c3d Mon Sep 17 00:00:00 2001 From: Mikers Date: Tue, 13 Aug 2024 07:06:36 -0700 Subject: [PATCH 1/2] Update node/config/types.go Co-authored-by: Rod Vagg --- node/config/types.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/node/config/types.go b/node/config/types.go index 1e57b579932..70464d5f498 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -482,9 +482,17 @@ type Pubsub struct { } type Chainstore struct { + // EXPERIMENTAL FEATURE. USE WITH CAUTION + // BadgerVersion switches the version of the Badger database engine. The default is 2 which has + // been well-tested and widely deployed. Switching this to version 4 will enable the new version + // of Badger, but the blockstore will be incompatible with Lotus running with version 2. Switching + // versions can only be done when the blockstore is empty and will be repopulated from a snapshot + // or chain sync. It cannot be upgraded or downgraded with existing data and there is currently + // no automatic migration tooling. + // This is an experimental feature and should not be used in production. + BadgerVersion int EnableSplitstore bool Splitstore Splitstore - BadgerVersion int } type Splitstore struct { From ee737c967c282cfec208ae50e4fd490635244267 Mon Sep 17 00:00:00 2001 From: Mikers Date: Tue, 13 Aug 2024 07:08:51 -0700 Subject: [PATCH 2/2] Update blockstore/badger/versions/badger.go Co-authored-by: Rod Vagg --- blockstore/badger/versions/badger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockstore/badger/versions/badger.go b/blockstore/badger/versions/badger.go index 8392e2fcc75..434211338e4 100644 --- a/blockstore/badger/versions/badger.go +++ b/blockstore/badger/versions/badger.go @@ -40,7 +40,7 @@ func OpenBadgerDB(opts Options) (BadgerDB, error) { db = BadgerDB(&BadgerV2{dbV2}) } default: - return nil, errors.New("unsupported badger version") + err = fmt.Errorf("unsupported badger version: %v", opts.BadgerVersion) } if err != nil {