Skip to content

Commit

Permalink
sql: fix a small race in distIndexBackfill
Browse files Browse the repository at this point in the history
This is another small data race in distIndexBackfill. This code was
operating on mu.updatedTodoSpans (without holding the lock) instead of
the copy that we created a few lines above (while holding the lock).

Release note: None
  • Loading branch information
stevendanna committed Feb 2, 2022
1 parent 4969711 commit b994851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ func (sc *SchemaChanger) distIndexBackfill(
if updatedTodoSpans == nil {
return nil
}
nRanges, err := numRangesInSpans(ctx, sc.db, sc.distSQLPlanner, mu.updatedTodoSpans)
nRanges, err := numRangesInSpans(ctx, sc.db, sc.distSQLPlanner, updatedTodoSpans)
if err != nil {
return err
}
Expand Down

0 comments on commit b994851

Please sign in to comment.