cockroachdb / cockroachdb/cockroach

backupccl: disallow backing up views in the absence of its dependant table

Open
#102,767 1 comment 0 reactions 0 assignees View on GitHub
A-disaster-recovery C-bug T-disaster-recovery
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

We allow a user to backup a view without backing up its dependant table. On attempting to restore just the view we raise an exception indicating that the user must restore the table along with the view or pass in the `skip_missing_views` option. If the user specifies the `skip_missing_views` option then nothing is restored. It seems like bad UX to allow a user to restore just the view only to not be able to restore it. The only use case I can imagine where backing up just the view is useful is:

- Customer takes database backup with a table foo in the database.
- View is created on foo.
- Customer takes incremental backup of just view foo.
- Customer restores database which brings backup both table and view.

A better alternative could be to just disallow backing up only the view without including the dependant table.

Jira issue: CRDB-27643

Contributor guide

Open the contributing guide

Research direction

Start with the backupccl handling for view backups and the skip_missing_views restore option. Trace how a view can be selected without its dependent table; done means that backup is rejected before restore can produce an unusable view, with coverage for the rejection and existing restore behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.