Comments (5)
How To
We have only one final state for every region.
- Pd caches whole region in memory.
- Leader peer for the region will report region status regularly.
For conf change
Leader 1 for region a asks ChangePeer, pd adds 2 to region a directly, so the region meta in etcd contains peer 1, 2 now. The region in TiKV must enter this final state.
If leader 1 asks ChangePeer again, pd still replies adding peer 2 directly until pd finds region a has peer 1, 2 and then does the following Conf change.
For split
Leader 1 for region a [a-c) asks Split, pd allocs the new region ID and peer IDs only.
Region a [a-c) splits -> a [a-b) + b [b-c).
Leader in region a [a-b) reports region info to pd, pd finds it is different from the memory cache, updates the pd first and then update cache.
Leader in region b [b-c) reports new region info to pd, pd finds it is not in cache and not in etcd, so adds it directly to etcd and cache.
Problem: If region a reports status first, but region b delayed, we may meet a gap in key range, because we don't know where to find the data in [b, c). But this gap may be fixed later.
from pd.
/cc @disksing Seems something should be done in ticlient
.
from pd.
One region can only do one thing at same time
Do you mean all command? including read-only request such as GetRegion?
Expanding 1, if pd decides how to do for the command, e,g, for region a, adding peer 3 for it, it will execute this job all the time, no matter how much times it retries or the leader asks.
This brings risk for dead lock. we have two 'state', one is in raft node, the other in pd.
- raft node send request to pd
- pd decides how to do and send job to raft node
- raft execute the job and update it's state to pd periodly
- pd response after it know state updated
the whole process forms a ring, if raft have some trouble and can't finish the job( although I haven't come up with a specific case), then dead lock will occur.
from pd.
b.t.w as long as we have GetRegion, those changes don't affect #102 much.... i.e. if peer found itself inactive for a long time, then it ask pd whether it's still live.
from pd.
Pd now has no job, so no deadlock.
from pd.
Related Issues (20)
- Support persisting ru consumption statistics data and return ru statistics in get response
- (security) v6.5.6 config encryption at rest for pd with aws kms key failed HOT 2
- pd cannot read resource limitation from cgroup with the systemd
- Panic when querying the region by ID if the region doesn't have a leader
- TestConfigTTL is unstable HOT 1
- [bug] Fix scripts/update-dashboard scripts to support dashboard semver style version
- TestRedirectWithMetrics date race
- [bug] tidb-dashboard instance profiling page show white screen
- Too much logs when forwarding heartbeat if there are some network problems
- There will be lots of balance leader operators after enabling scheduling service HOT 1
- The output is null when adding evict-leader-scheduler for second store
- add index failed with error '503 Service Unavailable' when kill pdleader HOT 2
- import into failed and tidb panic when inject pd leader network partition HOT 1
- PD continues sending merge operator to TiKV and then time out HOT 1
- Support using an option to decide if the request should be redirected to scheduling service
- Lightning: report TiFlash insufficient space
- Leader Lease expired time is later than log time
- TestScheduleTestSuite is unstable
- Make bench tools more powerful
- api: return `Operator` as JSON object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pd.