Skip to content

Commit 25fed4c

Browse files
authored
Merge pull request #145 from ipfs/11-12-improvements
11 to 12: Improvements to migration
2 parents af90efe + 844ea5a commit 25fed4c

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

fs-repo-11-to-12/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/ipfs/fs-repo-migrations/tools v0.0.0-20211209222258-754a2dcb82ea
88
github.com/ipfs/go-cid v0.0.7
99
github.com/ipfs/go-datastore v0.4.5
10+
github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5 // indirect
1011
github.com/ipfs/go-filestore v1.0.0
1112
github.com/ipfs/go-ipfs v0.8.0
1213
github.com/ipfs/go-ipfs-ds-help v1.0.0

fs-repo-11-to-12/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH
294294
github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk=
295295
github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE=
296296
github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk=
297-
github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU=
298297
github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA=
298+
github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5 h1:ovdpQk2ZVK6eQLzMCZy1z2tJae7yvE8xaPUw4Pr1RqI=
299+
github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA=
299300
github.com/ipfs/go-ds-flatfs v0.4.5 h1:4QceuKEbH+HVZ2ZommstJMi3o3II+dWS3IhLaD7IGHs=
300301
github.com/ipfs/go-ds-flatfs v0.4.5/go.mod h1:e4TesLyZoA8k1gV/yCuBTnt2PJtypn4XUlB5n8KQMZY=
301302
github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=

fs-repo-11-to-12/migration/swapper.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@ func (cswap *CidSwapper) Revert(unswapCh <-chan Swap) (uint64, error) {
6767
swapWorkerFunc := func() (uint64, uint64) {
6868
return cswap.unswapWorker(unswapCh)
6969
}
70-
// We only run 1 worker for revert. Migrations
71-
// many-cid-to-one-multihash mappings, but reverts can have the
72-
// opposite. The unswapWorker keeps a cache to handle that, but
73-
// this only works with a single worker. Otherwise we'd need
74-
// complex syncing, or delayed removal (increased datastore size).
75-
return cswap.runWorkers(1, swapWorkerFunc)
70+
return cswap.runWorkers(NWorkers, swapWorkerFunc)
7671
}
7772

7873
// Run workers launches several workers to run the given function which returns

fs-repo-11-to-12/vendor/github.com/ipfs/go-ds-badger/datastore.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fs-repo-11-to-12/vendor/modules.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ github.com/ipfs/go-datastore/mount
123123
github.com/ipfs/go-datastore/namespace
124124
github.com/ipfs/go-datastore/query
125125
github.com/ipfs/go-datastore/sync
126-
# github.com/ipfs/go-ds-badger v0.2.6
126+
# github.com/ipfs/go-ds-badger v0.2.7-0.20211210151007-a2805355dcf5
127+
## explicit
127128
github.com/ipfs/go-ds-badger
128129
# github.com/ipfs/go-ds-flatfs v0.4.5
129130
github.com/ipfs/go-ds-flatfs

0 commit comments

Comments
 (0)