diff --git a/client/internal/downloader/strategy/selector.go b/client/internal/downloader/strategy/selector.go index 98f81c5..c315bb0 100644 --- a/client/internal/downloader/strategy/selector.go +++ b/client/internal/downloader/strategy/selector.go @@ -39,7 +39,7 @@ type ECReconstructStrategy struct { Detail jcstypes.ObjectDetail Redundancy jcstypes.ECRedundancy Blocks []jcstypes.ObjectBlock - UserSpaces []jcstypes.UserSpaceDetail + UserSpaces []jcstypes.UserSpaceDetail // 与Blocks一一对应,表示每个Block应该从哪个UserSpace下载 } func (s *ECReconstructStrategy) GetDetail() jcstypes.ObjectDetail { @@ -50,7 +50,7 @@ type LRCReconstructStrategy struct { Detail jcstypes.ObjectDetail Redundancy jcstypes.LRCRedundancy Blocks []jcstypes.ObjectBlock - Spaces []jcstypes.UserSpaceDetail + Spaces []jcstypes.UserSpaceDetail // 与Blocks一一对应,表示每个Block应该从哪个UserSpace下载 } func (s *LRCReconstructStrategy) GetDetail() jcstypes.ObjectDetail { diff --git a/client/internal/services/user_space.go b/client/internal/services/user_space.go index 9e76238..2ff3b09 100644 --- a/client/internal/services/user_space.go +++ b/client/internal/services/user_space.go @@ -245,9 +245,9 @@ func (svc *UserSpaceService) DownloadPackage(req cliapi.UserSpaceDownloadPackage if shouldAtClient && strg.UserSpaces[i].RecommendHub != nil { newSpace := strg.UserSpaces[i] newSpace.RecommendHub = nil - ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, newSpace, ioswitch2.RawStream())) + ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, newSpace, ioswitch2.ECStream(b.Index))) } else { - ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, strg.UserSpaces[i], ioswitch2.RawStream())) + ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, strg.UserSpaces[i], ioswitch2.ECStream(b.Index))) } ft.ECParam = &strg.Redundancy diff --git a/client/internal/ticktock/redundancy_shrink.go b/client/internal/ticktock/redundancy_shrink.go index 50f115f..aeb9b1e 100644 --- a/client/internal/ticktock/redundancy_shrink.go +++ b/client/internal/ticktock/redundancy_shrink.go @@ -509,6 +509,7 @@ func (t *ChangeRedundancy) initBlockList(ctx *annealingState) { if blocks[i].Index == b.Index { blocks[i].HasEntity = true blocks[i].FileHash = b.FileHash + blocks[i].Size = b.Size has = true break } diff --git a/common/pkgs/ioswitch/exec/executor.go b/common/pkgs/ioswitch/exec/executor.go index 13fb7b5..7db9801 100644 --- a/common/pkgs/ioswitch/exec/executor.go +++ b/common/pkgs/ioswitch/exec/executor.go @@ -85,7 +85,11 @@ func (s *Executor) runOps(ops []Op, ctx *ExecContext, cancel context.CancelFunc) err = context.Canceled } } else { - err = multierror.Append(err, fmt.Errorf("%T: %w", op, e)) + if err == context.Canceled { + err = e + } else { + err = multierror.Append(err, fmt.Errorf("%T: %w", op, e)) + } } lock.Unlock()