Skip to content

backupccl: teach makeSimpleImportSpans to exclude backup data on spans that were later reintroduced #87305

@msbutler

Description

@msbutler

Currently RESTORE cannot properly handle restoring a table that had a non-mvcc rollback, without adding some logic to makeSimpleImportSpans.

Consider the following timeline:

  1. Begin IMPORT INTO on existing table foo, ingest some data
  2. Backup foo
  3. Rollback IMPORT via clearRange
  4. Incremental backup of foo, with a full reintroduction of foo’s span
  5. RESTORE foo: the imported data leaks into the restore
  • See test here. grep for “this is bad”

This occurs because 1) makeSimpleImportSpans naively includes the backup file with the imported data as part of foo's restoreSpanEntry and 2) the backups have MVCC delete history related to the rollback. This was never a problem in previous releases because offline importing data were not backed up until the import succeeded.

To address this, makeSimpleImportSpan needs to exclude backup files for a span that was later reintroduced due to a non-mvcc bulk op.

Jira issue: CRDB-19262

Metadata

Metadata

Assignees

Labels

A-disaster-recoveryC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.C-technical-advisoryCaused a technical advisoryT-disaster-recoverybranch-release-21.2Used to mark GA and release blockers, technical advisories, and bugs for 21.2branch-release-22.1Used to mark GA and release blockers, technical advisories, and bugs for 22.1

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions