release-21.2: backup: use correct Context in restore workers #76509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #74905 on behalf of @dt.
/cc @cockroachdb/release
Previously some of the workers, which are called by ctxgroup goroutines,
were using RestoreDataProcessor.Ctx, instead of the child context that
the group created, which, critically, is cancelled if any group task
fails. This could mean one worker in the group fails and stops draining
a channel and returns an error to the group, which cancels its context,
but another worker trying to write to that channel hangs if it is not
checking the passed, now cancelled context.
Release note (bug fix): fix a case where a RESTORE job could hang if it encountered an error when ingesting restored data.
Release justification: bug fix.