Open
Conversation
Cauchy-NY
suggested changes
Jun 9, 2023
| "[FaultTolerance][MigrationPolicy][iginx={}, id={}] generate migration plan", | ||
| metaManager.getIginxId(), | ||
| sourceStorageId); | ||
| for (StorageUnitMeta meta : metaManager.getStorageUnits()) { |
|
|
||
| import java.util.Map; | ||
|
|
||
| public class StorageMigrationPlan { |
| 2: required list<RemovedStorageEngineInfo> dummyStorageInfoList | ||
| } | ||
|
|
||
| struct RemoveStorageEngineReq { |
Collaborator
There was a problem hiding this comment.
我认为同步异步应该拆成两个接口
- 同步接口返回执行的状态,标识移除节点的任务完成情况
- 异步节点返回任务id,用户能根据任务id来查询对应任务的执行情况
基于2,应该新增一个查询任务状态的接口
| .stream() | ||
| .filter(e -> !e.isDummy()) | ||
| .filter(e -> e.getState() != StorageUnitState.DISCARD) | ||
| .collect(Collectors.groupingBy(StorageUnitMeta::getStorageEngineId)); |
Collaborator
There was a problem hiding this comment.
这块我理解没必要进行分类,从上下文来看,主要想获取两个信息
- 待删除节点内的du
- 所有的节点list
| priorities.sort(StoragePriority::compareTo); | ||
| long avoid = sourceStorageId; | ||
| if (!storageUnit.isMaster()) { | ||
| StorageUnitMeta masterUnit = metaManager.getStorageUnit(storageUnit.getMasterId()); |
Collaborator
There was a problem hiding this comment.
没有avoid其他非主du,可能会出现两个副本存在同一个存储节点上的情况
|
|
||
| import cn.edu.tsinghua.iginx.metadata.IMetaManager; | ||
|
|
||
| public abstract class StorageMigrationPolicy { |
Collaborator
There was a problem hiding this comment.
MigrationPolicy——StorageMigrationPolicy
GreedyMigrationPolicy——GreedyStorageMigrationPolicy
他们之间的区别是什么,从名字上来看不是很直观能看出区别
| } | ||
|
|
||
| @Override | ||
| public Status removeStorageEngine(RemoveStorageEngineReq req) { |
Collaborator
There was a problem hiding this comment.
移除节点&迁移数据一般都是个比较长的过程,是否应该考虑用户重复发请求的情况呢
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.