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-19.2: backupccl: stop including OFFLINE tables in backup #42735

Merged
merged 1 commit into from Dec 2, 2019

Conversation

pbardea
Copy link
Contributor

@pbardea pbardea commented Nov 25, 2019

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 in
a 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.

@pbardea pbardea requested a review from dt November 25, 2019 16:08
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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 in
a 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.
@pbardea pbardea merged commit 6facc9e into cockroachdb:release-19.2 Dec 2, 2019
@pbardea pbardea deleted the backport19.2-42606 branch December 2, 2019 22:02
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

2 participants