Skip to content

Commit 70fd7be

Browse files
committed
address the comment
Signed-off-by: Ryan Leung <rleungx@gmail.com>
1 parent 710e14f commit 70fd7be

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

media/node-state-transition.png

40.9 KB
Loading

text/0084-pd-http-api-v2.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,20 @@ As for heartbeat status, we only add one normal status named `Alive` into the pr
9090

9191
With these changes, we can do more things like dynamically adjusting scheduling parameters, progress estimation, etc.
9292

93+
#### Node state transition
94+
95+
Here is the newly node state transition graph:
96+
97+
![node state transition](../media/node-state-transition.png)
98+
99+
1. When a store is newly added to the cluster, we regard it as Preparing. Once it reaches the threshold of its expected region size, it turns into a Serving state.
100+
2. When a store in Serving state receives the delete store command/HTTP request, it will be changed to Removing state.
101+
3. When we don't want to remove the previous store in Removing state, we can use the cancel delete command or through HTTP request to change the node state back to Serving.
102+
4. When a store is in Preparing state, we can also remove it through the delete store command/HTTP request.
103+
5. When a store in Removing state has moved all regions on it to the rest stores, it finally becomes Removed.
104+
105+
The threshold of the expected region size in 1 is calculated by accumulating the store region size for each range of the defined placement rules.
106+
For each given range, we first get all rules which involve this range. And for each rule, we get the size of a single replica and then multiply the count defined in the rule to get the expected region size of this rule. Because each placement rule could have different label constraints, so we can obtain the region size weight of a store through the label constraints. Then multiply these two things, we can obtain the store region size of this range.
107+
93108
## Compatibility
94109
Once the implementation has been finished, we need to replace the old API with the new version for all components and tools. Also, we should let the user know about this change. The V1 will still leave for some time for compatibility and be deprecated finally.

0 commit comments

Comments
 (0)