pika
pika copied to clipboard
slot auto split, solve the problem of too many preset slots
Which PikiwiDB functionalities are relevant/related to the feature request?
No response
Description
参考咨询Alice.g
Proposed solution
参考咨询Alice.g
Alternatives considered
参考咨询Alice.g
Bot detected the issue body's language is not English, translate it automatically.
Title: slot auto split, solve the problem of too many preset slots
@sunjiajun
Bot detected the issue body's language is not English, translate it automatically.
@SunJiajun
整体思路:
- 修改 maxSlotNum 变量
- 重新调用 SlotsRebalance 方法更新 slots(当前测试存在问题,需要对 SlotsRebalance debug)
具体思路:
- 修改 model.initSlotNum 的类型为 sync.Mutex
- 修改 SetMaxSlotNum 方法
- 在 Dashboard 中添加 SetMaxSlotNum(num int) 方法允许设置 maxSlotNum
- debug SlotsRebalance 方法实现 slot 重新划分
- 修改 codis-fe 中 slot 的相关逻辑
Bot detected the issue body's language is not English, translate it automatically.
the whole idea:
- Modify maxSlotNum variable
- Recall the SlotsRebalance method to update slots (there is a problem in the current test and SlotsRebalance needs to be debugged)
Specific ideas:
- Modify the type of model.initSlotNum to sync.Mutex
- Modify the SetMaxSlotNum method
- Add SetMaxSlotNum(num int) method in Dashboard to allow setting maxSlotNum
- debug SlotsRebalance method to implement slot re-division
- Modify the relevant logic of slot in codis-fe
思路没问题 需要注意的是 pika和codis都需要修改config配置,另外迁移数据需要打开slotmigrate及slotsreload
Bot detected the issue body's language is not English, translate it automatically.
The idea is OK. It should be noted that both pika and codis need to modify the config configuration. In addition, to migrate data, slotmigrate and slotsreload need to be turned on.
@baerwang
Bot detected the issue body's language is not English, translate it automatically.
@baerwang