pingcap / pingcap/tiflash

Support materialized view out-of-place complete refresh cutover in TiFlash schema sync

Open
#10,773 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects-8.5 component/compute type/enhancement
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Enhancement

Support materialized view out-of-place complete refresh in TiFlash schema sync.

Background:

  • TiDB introduces ActionCreateMaterializedViewShadow to create the shadow materialized view table during out-of-place refresh.
  • TiDB introduces ActionMViewRefreshOutOfPlaceCutover to atomically cut over from the old materialized view table to the refreshed shadow table.
  • TiFlash schema sync needs to understand both actions so local metadata stays consistent during the refresh flow.

Expected behavior:

  • Treat ActionCreateMaterializedViewShadow like materialized view table creation and register the shadow table in schema sync.
  • Handle ActionMViewRefreshOutOfPlaceCutover by renaming the shadow table to the logical MV name and tombstoning the old MV table ID in the same schema version.
  • Add schema sync test coverage for the full out-of-place refresh cutover flow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the TiFlash schema sync handling for materialized view table creation and trace how schema actions update local metadata. Add coverage for ActionCreateMaterializedViewShadow followed by ActionMViewRefreshOutOfPlaceCutover, verifying the shadow is renamed to the logical materialized view name and the old table ID is tombstoned in the same schema version.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.