Skip to content

Commit

Permalink
add some more tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Sep 19, 2023
1 parent b97d9e6 commit 9732b5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions carstore/bs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,13 @@ func (cs *CarStore) CompactUserShards(ctx context.Context, user models.Uid) erro
// now we need to delete the staleRefs we successfully cleaned up
// we can delete a staleRef if all the shards that have blockRefs with matching stale refs were processed

return cs.deleteStaleRefs(ctx, brefs, staleRefs, removedShards)
}

func (cs *CarStore) deleteStaleRefs(ctx context.Context, brefs []blockRef, staleRefs []staleRef, removedShards map[uint]bool) error {
ctx, span := otel.Tracer("carstore").Start(ctx, "deleteStaleRefs")
defer span.End()

brByCid := make(map[cid.Cid][]blockRef)
for _, br := range brefs {
brByCid[br.Cid.CID] = append(brByCid[br.Cid.CID], br)
Expand Down

0 comments on commit 9732b5d

Please sign in to comment.