| @@ -39,7 +39,7 @@ type ECReconstructStrategy struct { | |||||
| Detail jcstypes.ObjectDetail | Detail jcstypes.ObjectDetail | ||||
| Redundancy jcstypes.ECRedundancy | Redundancy jcstypes.ECRedundancy | ||||
| Blocks []jcstypes.ObjectBlock | Blocks []jcstypes.ObjectBlock | ||||
| UserSpaces []jcstypes.UserSpaceDetail | |||||
| UserSpaces []jcstypes.UserSpaceDetail // 与Blocks一一对应,表示每个Block应该从哪个UserSpace下载 | |||||
| } | } | ||||
| func (s *ECReconstructStrategy) GetDetail() jcstypes.ObjectDetail { | func (s *ECReconstructStrategy) GetDetail() jcstypes.ObjectDetail { | ||||
| @@ -50,7 +50,7 @@ type LRCReconstructStrategy struct { | |||||
| Detail jcstypes.ObjectDetail | Detail jcstypes.ObjectDetail | ||||
| Redundancy jcstypes.LRCRedundancy | Redundancy jcstypes.LRCRedundancy | ||||
| Blocks []jcstypes.ObjectBlock | Blocks []jcstypes.ObjectBlock | ||||
| Spaces []jcstypes.UserSpaceDetail | |||||
| Spaces []jcstypes.UserSpaceDetail // 与Blocks一一对应,表示每个Block应该从哪个UserSpace下载 | |||||
| } | } | ||||
| func (s *LRCReconstructStrategy) GetDetail() jcstypes.ObjectDetail { | func (s *LRCReconstructStrategy) GetDetail() jcstypes.ObjectDetail { | ||||
| @@ -245,9 +245,9 @@ func (svc *UserSpaceService) DownloadPackage(req cliapi.UserSpaceDownloadPackage | |||||
| if shouldAtClient && strg.UserSpaces[i].RecommendHub != nil { | if shouldAtClient && strg.UserSpaces[i].RecommendHub != nil { | ||||
| newSpace := strg.UserSpaces[i] | newSpace := strg.UserSpaces[i] | ||||
| newSpace.RecommendHub = nil | newSpace.RecommendHub = nil | ||||
| ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, newSpace, ioswitch2.RawStream())) | |||||
| ft.AddFrom(ioswitch2.NewFromShardstore(b.FileHash, newSpace, ioswitch2.ECStream(b.Index))) | |||||
| } else { | } 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 | ft.ECParam = &strg.Redundancy | ||||
| @@ -509,6 +509,7 @@ func (t *ChangeRedundancy) initBlockList(ctx *annealingState) { | |||||
| if blocks[i].Index == b.Index { | if blocks[i].Index == b.Index { | ||||
| blocks[i].HasEntity = true | blocks[i].HasEntity = true | ||||
| blocks[i].FileHash = b.FileHash | blocks[i].FileHash = b.FileHash | ||||
| blocks[i].Size = b.Size | |||||
| has = true | has = true | ||||
| break | break | ||||
| } | } | ||||
| @@ -85,7 +85,11 @@ func (s *Executor) runOps(ops []Op, ctx *ExecContext, cancel context.CancelFunc) | |||||
| err = context.Canceled | err = context.Canceled | ||||
| } | } | ||||
| } else { | } 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() | lock.Unlock() | ||||