diff --git a/fs-repo-11-to-12/go.mod b/fs-repo-11-to-12/go.mod index a0fbc7a9..6a666f19 100644 --- a/fs-repo-11-to-12/go.mod +++ b/fs-repo-11-to-12/go.mod @@ -7,6 +7,7 @@ require ( github.com/ipfs/fs-repo-migrations/tools v0.0.0-20211209222258-754a2dcb82ea github.com/ipfs/go-cid v0.0.7 github.com/ipfs/go-datastore v0.4.5 + github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5 // indirect github.com/ipfs/go-filestore v1.0.0 github.com/ipfs/go-ipfs v0.8.0 github.com/ipfs/go-ipfs-ds-help v1.0.0 diff --git a/fs-repo-11-to-12/go.sum b/fs-repo-11-to-12/go.sum index 3940aa3a..a71c85a3 100644 --- a/fs-repo-11-to-12/go.sum +++ b/fs-repo-11-to-12/go.sum @@ -294,8 +294,9 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU= github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= +github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5 h1:ovdpQk2ZVK6eQLzMCZy1z2tJae7yvE8xaPUw4Pr1RqI= +github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-flatfs v0.4.5 h1:4QceuKEbH+HVZ2ZommstJMi3o3II+dWS3IhLaD7IGHs= github.com/ipfs/go-ds-flatfs v0.4.5/go.mod h1:e4TesLyZoA8k1gV/yCuBTnt2PJtypn4XUlB5n8KQMZY= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= diff --git a/fs-repo-11-to-12/migration/swapper.go b/fs-repo-11-to-12/migration/swapper.go index a41630df..df029ec9 100644 --- a/fs-repo-11-to-12/migration/swapper.go +++ b/fs-repo-11-to-12/migration/swapper.go @@ -67,12 +67,7 @@ func (cswap *CidSwapper) Revert(unswapCh <-chan Swap) (uint64, error) { swapWorkerFunc := func() (uint64, uint64) { return cswap.unswapWorker(unswapCh) } - // We only run 1 worker for revert. Migrations - // many-cid-to-one-multihash mappings, but reverts can have the - // opposite. The unswapWorker keeps a cache to handle that, but - // this only works with a single worker. Otherwise we'd need - // complex syncing, or delayed removal (increased datastore size). - return cswap.runWorkers(1, swapWorkerFunc) + return cswap.runWorkers(NWorkers, swapWorkerFunc) } // Run workers launches several workers to run the given function which returns diff --git a/fs-repo-11-to-12/vendor/github.com/ipfs/go-ds-badger/datastore.go b/fs-repo-11-to-12/vendor/github.com/ipfs/go-ds-badger/datastore.go index b2c2e7fa..34780b4f 100644 --- a/fs-repo-11-to-12/vendor/github.com/ipfs/go-ds-badger/datastore.go +++ b/fs-repo-11-to-12/vendor/github.com/ipfs/go-ds-badger/datastore.go @@ -88,7 +88,7 @@ var DefaultOptions Options func init() { DefaultOptions = Options{ GcDiscardRatio: 0.2, - GcInterval: 15 * time.Minute, + GcInterval: 2 * time.Minute, GcSleep: 10 * time.Second, Options: badger.LSMOnlyOptions(""), } diff --git a/fs-repo-11-to-12/vendor/modules.txt b/fs-repo-11-to-12/vendor/modules.txt index 7a8443f8..d4b3b274 100644 --- a/fs-repo-11-to-12/vendor/modules.txt +++ b/fs-repo-11-to-12/vendor/modules.txt @@ -123,7 +123,8 @@ github.com/ipfs/go-datastore/mount github.com/ipfs/go-datastore/namespace github.com/ipfs/go-datastore/query github.com/ipfs/go-datastore/sync -# github.com/ipfs/go-ds-badger v0.2.6 +# github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5 +## explicit github.com/ipfs/go-ds-badger # github.com/ipfs/go-ds-flatfs v0.4.5 github.com/ipfs/go-ds-flatfs