pingcap / pingcap/tiflash

Split Context into multiples partials, and only change partials

Open
#7,000 0 comments 2 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

Enhancement

Currently we have a huge Context, which is imported in many .cpp files or even .h files. When we want to introduce something global, a large number of files (and nearly all test cases) need to be recompiled. It is very slow.

We can split Context into different partials, As the first step, we may split as:

  • SharedContextDisagg: Global modules that related with disaggregated mode.
  • SharedContextStorage: Global modules that related with storages, for example, PS instances, read & write limiters, etc.
  • Context: Everything remains

TMTContext is untouched.

Hope this change could allow us changing Context.h much less frequently.

We do not eliminate the import of Context.h. Instead, we eliminate the changing of Context.h.

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 Context.h and its current .cpp and .h consumers, then trace the global modules related to disaggregated mode and storage listed in the issue. Done means those modules are separated into SharedContextDisagg and SharedContextStorage, remaining functionality stays in Context, and TMTContext is unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.