| 496 | } |
| 497 | |
| 498 | func (r *ShardRecover) directGetShard(ctx context.Context, repairBids []proto.BlobID, repairIdxs []uint8) (failBids []proto.BlobID, allocBufErr error) { |
| 499 | span := trace.SpanFromContextSafe(ctx) |
| 500 | span.Info("start direct get shard") |
| 501 | |
| 502 | allocBufErr = r.allocBuf(ctx, repairIdxs) |
| 503 | if allocBufErr != nil { |
| 504 | return nil, allocBufErr |
| 505 | } |
| 506 | replicas := make(Vunits, len(repairIdxs)) |
| 507 | for i, idx := range repairIdxs { |
| 508 | replicas[i] = r.replicas[idx] |
| 509 | } |
| 510 | |
| 511 | r.download(ctx, repairBids, replicas) |
| 512 | failBids = r.collectFailBids(repairBids, repairIdxs) |
| 513 | span.Infof("end direct get shard: failBids len[%d], allocBufErr[%+v]", len(failBids), allocBufErr) |
| 514 | |
| 515 | return failBids, allocBufErr |
| 516 | } |
| 517 | |
| 518 | func (r *ShardRecover) recoverByLocalStripe(ctx context.Context, repairBids []proto.BlobID, repairIdxs []uint8) (err error) { |
| 519 | span := trace.SpanFromContextSafe(ctx) |