Skip to content

Commit

Permalink
Extend Region & Remove Region & Reconstruct Region (#14634)
Browse files Browse the repository at this point in the history
* save

* it works

* fxxk it

* add files

* merge master & save, need to do submit procedure

* basically done

* rename RegionMemberChangeProcedure to RegionOperationProcedure

* move function & files

* add IT

* add reconstruct IT

* spotless

* fix IT

* spotless

* Tan review

* use leader as coordinator & fix IT
  • Loading branch information
liyuheng55555 authored Jan 17, 2025
1 parent 49a91ec commit 141b7ba
Show file tree
Hide file tree
Showing 60 changed files with 1,896 additions and 325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.iotdb.it.env;

import org.apache.iotdb.it.env.cluster.env.AIEnv;
import org.apache.iotdb.it.env.cluster.env.AbstractEnv;
import org.apache.iotdb.it.env.cluster.env.Cluster1Env;
import org.apache.iotdb.it.env.cluster.env.SimpleEnv;
import org.apache.iotdb.it.env.remote.env.RemoteServerEnv;
Expand Down Expand Up @@ -75,4 +76,8 @@ public static BaseEnv getEnv() {
}
return env;
}

public static AbstractEnv getAbstractEnv() {
return (AbstractEnv) getEnv();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ private Map<String, Integer> countNodeStatus(final Map<Integer, String> nodeStat
return result;
}

public void checkNodeInStatus(int nodeId, NodeStatus expectation) {
checkClusterStatus(nodeStatusMap -> expectation.getStatus().equals(nodeStatusMap.get(nodeId)));
}

public void checkClusterStatusWithoutUnknown() {
checkClusterStatus(
nodeStatusMap -> nodeStatusMap.values().stream().noneMatch("Unknown"::equals));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public String getLogDirPath() {
+ getTimeForLogDirectory(startTime);
}

@Override
String getNodeType() {
return "ainode";
}

@Override
public void start() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,18 @@ public String getNodePath() {
return System.getProperty(USER_DIR) + File.separator + TARGET + File.separator + getId();
}

public String getDataPath() {
return getNodePath()
+ File.separator
+ IoTDBConstant.DATA_FOLDER_NAME
+ File.separator
+ getNodeType()
+ File.separator
+ IoTDBConstant.DATA_FOLDER_NAME;
}

abstract String getNodeType();

public void dumpJVMSnapshot(String testCaseName) {
JMXServiceURL url;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ protected void addStartCmdParams(final List<String> params) {
"-s"));
}

@Override
String getNodeType() {
return "confignode";
}

@Override
protected void reloadMutableFields() {
mutableCommonProperties.setProperty(CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS, SIMPLE_CONSENSUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ protected void addStartCmdParams(final List<String> params) {
"-s"));
}

@Override
String getNodeType() {
return "datanode";
}

@Override
protected void reloadMutableFields() {
mutableCommonProperties.setProperty(CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS, SIMPLE_CONSENSUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.junit.Before;

public class IoTDBRegionMigrateDataNodeCrashITFrameworkForIoTV1
extends IoTDBRegionMigrateReliabilityITFramework {
extends IoTDBRegionOperationReliabilityITFramework {

@Override
@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.iotdb.commons.utils.KillPoint.KillNode;

public class IoTDBRegionMigrateDataNodeCrashITFrameworkForIoTV2
extends IoTDBRegionMigrateReliabilityITFramework {
extends IoTDBRegionOperationReliabilityITFramework {

@SafeVarargs
public final <T extends Enum<T>> void success(T... dataNodeKillPoints) throws Exception {
Expand Down
Loading

0 comments on commit 141b7ba

Please sign in to comment.