pingcap / pingcap/tiflash

Totally eliminate the table lock between reading and DDL operations

Open
#1,853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

After https://github.com/pingcap/tics/issues/1162, (PR: https://github.com/pingcap/tics/pull/1736), we still need to hold a read lock on alter_lock for building the TableScan operation and decoding Raft data. After the TableScan operation built / Raft data decoded to Block, we release the alter_lock and only keep the drop_lock for reading/writing.
Normally, building TableScan operation, decoding Raft data, apply a single DDL operation does not block for a long time.

Need further Investigation on whether we can totally eliminate the alter_lock between reading/writing/DDL operations.

The main focus point between reading and DDL operations is the race problem https://github.com/pingcap/tics/pull/1736#discussion_r622055228. Reading data with a TableScan operation with an older schema is not supported by the DeltaTree engine.

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 reviewing issue #1162, PR #1736, and the linked race discussion. Then trace how alter_lock and drop_lock protect TableScan construction, Raft decoding, and DDL application. Done requires determining whether alter_lock can be removed without permitting unsupported reads with an older schema, and documenting or implementing a safe resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.