pingcap / pingcap/tiflash

Reduce the blast radius when exception thrown in ApplySnapshot / IngestSST

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

Nobody has claimed this yet.

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

Description

Enhancement

Consider just let the related region not be able to read instead of panic the TiFlash process when meets unexpected behavior like https://github.com/pingcap/tiflash/issues/10147

After a RaftLog is received on the tiflash-proxy, but fails to apply to TiFlash storage. There is no mechanism to "rollback" or "throw away" the RaftLog (so does it for TiKV AFAIK). Now when exception detected when applying RaftLog or Raft snapshots, TiFlash always panic, causing TiFlash downtime.
In order to control the blast radius, we have to address these problems:

  1. TiFlash need to confirm whether each check fails impact scope, whether it only affect the current Region, or table, or the TiFlash node, or even the whole cluster.
    1. This requires carefully discussion over each check on the RaftLog/Raft Snapshot handling routine
    2. Also it require to check the DDL routine on TiFlash, because decoding RaftLog/Raft Snapshot will trigger DDL syncing
  2. How to handle the following reading / writing request after the abnormality happen?
    1. Can we reject the following writing to Region/Table/TiFlash node without great impact to the cluster?
    2. Alternatively, can TiFlash reject the raft-log in a more pre-checking stage? Like rejecting the raft-log message with invalid key-range from TiKV?
    3. Can we reject the following reading request to Region/Table/TiFlash node without great impact to the cluster?

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 by tracing the ApplySnapshot and IngestSST paths, then review the RaftLog/Raft Snapshot handling and DDL syncing mentioned in the issue. Document which failures affect a Region, table, node, or cluster, and define the read/write behavior and pre-checking needed for each scope. Done means the blast radius and abnormal-request handling are specified clearly enough to implement.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.