Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

support remove node #69

wants to merge 3 commits into from

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.

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

@@ -600,6 +600,12 @@ struct RemoveHistoryDataSourceReq {
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
他们之间的区别是什么,从名字上来看不是很直观能看出区别

@@ -258,6 +259,33 @@ public Status removeHistoryDataSource(RemoveHistoryDataSourceReq req) {
return status;
}

@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