Skip to content

backfill: index backfills should write rows at their current MVCC timestamp #63741

@ajwerner

Description

@ajwerner

Is your feature request related to a problem? Please describe.

Today the index backfiller writes batches using the MVCC timestamp at which it read the row. This, I suspect, was done to make incremental backups seem to work; they are already broken (#62585). The new schema change logic intends to perform schema changes by populating a new primary index (#47989). Changefeeds are going to work okay with this for the most part because they should plan themselves using the descriptors as of their start time and then restart when the primary index changes. The odd behavior will come in when using with diff. Today's behavior will show the before timestamp as corresponding to the the timestamp at which the old row was read for backfill. That's a bizarre timestamp. If we maintained the MVCC timestamp, that'd be relatively sane. An oddity arises if you got a logical backfill due to the schema change.

Describe the solution you'd like

Use the row MVCC timestamp when populating the index.

Additional context

If we ever expose the history of versions and want the timestamps to be meaningful across schema changes, we need to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions