release-19.2: backupccl: stop including OFFLINE tables in backup #42735
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 #42606.
/cc @cockroachdb/release
In 19.2, the OFFLINE table descriptor state was added. This state
indicates that the table is generally not visible to users as it is
being populated by the database (via an in-progress RESTORE or IMPORT).
However, these tables are currently included in backups.
When performing a BACKUP while a RESTORE or IMPORT is being executed,
there will be tables that exist in an OFFLINE state. These should not be
included in a BACKUP as when they are restored they will appear to be in
an intermediary and potentially inconsistent state.
Consider an OFFLINE table
bank.pause
. This table could be included ina backup either via directly naming the table:
BACKUP bank.pause TO ...
or via table expansion:BACKUP bank.* TO ...
. In the first case,an error should be returned as the table should not be directly visible
to the user. In the later case, OFFLINE tables should be silently
ignored since the OFFLINE table was not explicitly requested by the
user. The remaining PUBLIC tables in the database should be expanded.
Note: this commit also changes the name resolution logic for
changefeeds in the same way that it applies to backup.
To address this, the BACKUP and RESTORE name resolution logic was
modified to support filtering OFFLINE tables.
Release note (bug fix): Stop including tables that are being restored or
imported as valid targets in backups and changefeeds.