-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support remove node #69
base: main
Are you sure you want to change the base?
Conversation
"[FaultTolerance][MigrationPolicy][iginx={}, id={}] generate migration plan", | ||
metaManager.getIginxId(), | ||
sourceStorageId); | ||
for (StorageUnitMeta meta : metaManager.getStorageUnits()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一段日志输出完全可以和下面那段筛选合并
|
||
import java.util.Map; | ||
|
||
public class StorageMigrationPlan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
成员变量添加一下对应的注释
@@ -600,6 +600,12 @@ struct RemoveHistoryDataSourceReq { | |||
2: required list<RemovedStorageEngineInfo> dummyStorageInfoList | |||
} | |||
|
|||
struct RemoveStorageEngineReq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我认为同步异步应该拆成两个接口
- 同步接口返回执行的状态,标识移除节点的任务完成情况
- 异步节点返回任务id,用户能根据任务id来查询对应任务的执行情况
基于2,应该新增一个查询任务状态的接口
.stream() | ||
.filter(e -> !e.isDummy()) | ||
.filter(e -> e.getState() != StorageUnitState.DISCARD) | ||
.collect(Collectors.groupingBy(StorageUnitMeta::getStorageEngineId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这块我理解没必要进行分类,从上下文来看,主要想获取两个信息
- 待删除节点内的du
- 所有的节点list
priorities.sort(StoragePriority::compareTo); | ||
long avoid = sourceStorageId; | ||
if (!storageUnit.isMaster()) { | ||
StorageUnitMeta masterUnit = metaManager.getStorageUnit(storageUnit.getMasterId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有avoid其他非主du,可能会出现两个副本存在同一个存储节点上的情况
|
||
import cn.edu.tsinghua.iginx.metadata.IMetaManager; | ||
|
||
public abstract class StorageMigrationPolicy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MigrationPolicy——StorageMigrationPolicy
GreedyMigrationPolicy——GreedyStorageMigrationPolicy
他们之间的区别是什么,从名字上来看不是很直观能看出区别
@@ -258,6 +259,33 @@ public Status removeHistoryDataSource(RemoveHistoryDataSourceReq req) { | |||
return status; | |||
} | |||
|
|||
@Override | |||
public Status removeStorageEngine(RemoveStorageEngineReq req) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除节点&迁移数据一般都是个比较长的过程,是否应该考虑用户重复发请求的情况呢
No description provided.