release-20.2: backupccl: idempotently restore system tables in cluster restore #61217
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 #60458.
/cc @cockroachdb/release
Previously, if a cluster restore were to restart (e.g. in the case of
the coordinator crashing) after restoring the system tables, but before
completing, the job would attempt to restore the system table data again
and potentially fail on non-idempotent system table restoration
functions (e.g. restoring jobs).
This commit, adds a new SystemTablesRestored field to the restore
details to keep track of each system table that it has restored and
maintains progress. This is required, since not all system tables may
need to be restored atomically in the future.
Release note (bug fix): Fix a bug where cluster restore would sometimes
(very rarely) fail after retrying.
Release justification: bug fix