Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-20.2: backup: revalidate restored indexes if added during inc backup #63314

Merged
merged 1 commit into from Apr 13, 2021

Conversation

dt
Copy link
Member

@dt dt commented Apr 8, 2021

Backport 1/1 commits from #62701.

/cc @cockroachdb/release


Incremental backups of indexes being built can miss some index entries.

Recent changes mean backup now avoids backing up such an index until it
is complete, but older backups may have these indexes that were caught
mid-backfill. This change identifies indexes that were offline / building
in any layer of the backup and then for those that are to be restored
to a public state, re-runs validation after restore ensure the index
has the expected entries.

Currently if any restored index is missing entries, it is marked offline for
reconstruction post-RESTORE.

Release note (sql change): RESTORE now re-validates restored indexes if they were restored
from an incremental backup that was taken while the index was being created.

@dt dt requested review from pbardea, ajwerner and a team April 8, 2021 15:56
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member Author

dt commented Apr 8, 2021

this was far from a clean backport because of all the schema/catalog/desc changes, but I think I got it working and the test passes.

@shermanCRL
Copy link
Contributor

Addresses parent issue #63162

Incremental backups of indexes being built can miss some index entries.

Recent changes mean backup now avoids backing up such an index until it
is complete, but older backups may have these indexes that were caught
mid-backfill. This change identifies indexes that were offline / building
in any layer of the backup and then for those that are to be restored
to a public state, re-runs validation after restore ensure the index
has the expected entries.

If any restored index is missing entries, the restore marks it as adding
rather than public, so that a job can be synthesizes to rebuild it.

Release note (sql change): RESTORE now re-validates restored indexes if they were restored
from an incremental backup that was taken while the index was being created.
@dt dt merged commit a7a4422 into cockroachdb:release-20.2 Apr 13, 2021
@dt dt deleted the backport20.2-62701 branch April 13, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants