Skip to content

support remove node#69

Open
iznauy wants to merge 3 commits intomainfrom
remove_node
Open

support remove node#69
iznauy wants to merge 3 commits intomainfrom
remove_node

Conversation

@iznauy
Copy link
Collaborator

@iznauy iznauy commented Apr 26, 2023

No description provided.

"[FaultTolerance][MigrationPolicy][iginx={}, id={}] generate migration plan",
metaManager.getIginxId(),
sourceStorageId);
for (StorageUnitMeta meta : metaManager.getStorageUnits()) {
Copy link
Collaborator

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

成员变量添加一下对应的注释

2: required list<RemovedStorageEngineInfo> dummyStorageInfoList
}

struct RemoveStorageEngineReq {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我认为同步异步应该拆成两个接口

  1. 同步接口返回执行的状态,标识移除节点的任务完成情况
  2. 异步节点返回任务id,用户能根据任务id来查询对应任务的执行情况
    基于2,应该新增一个查询任务状态的接口

.stream()
.filter(e -> !e.isDummy())
.filter(e -> e.getState() != StorageUnitState.DISCARD)
.collect(Collectors.groupingBy(StorageUnitMeta::getStorageEngineId));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块我理解没必要进行分类,从上下文来看,主要想获取两个信息

  1. 待删除节点内的du
  2. 所有的节点list

priorities.sort(StoragePriority::compareTo);
long avoid = sourceStorageId;
if (!storageUnit.isMaster()) {
StorageUnitMeta masterUnit = metaManager.getStorageUnit(storageUnit.getMasterId());
Copy link
Collaborator

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MigrationPolicy——StorageMigrationPolicy
GreedyMigrationPolicy——GreedyStorageMigrationPolicy
他们之间的区别是什么,从名字上来看不是很直观能看出区别

}

@Override
public Status removeStorageEngine(RemoveStorageEngineReq req) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移除节点&迁移数据一般都是个比较长的过程,是否应该考虑用户重复发请求的情况呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants