You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2018/07/09 22:57:16 UTC
[1/4] helix git commit: Fix log output.
Repository: helix
Updated Branches:
refs/heads/master 2049f93ab -> a9cdecc64
Fix log output.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/a9cdecc6
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/a9cdecc6
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/a9cdecc6
Branch: refs/heads/master
Commit: a9cdecc644608725e4f561da23e3976226b44430
Parents: a979f35
Author: Lei Xia <lx...@linkedin.com>
Authored: Thu May 24 14:28:21 2018 -0700
Committer: Junkai Xue <jx...@jxue-mn2.linkedin.biz>
Committed: Mon Jul 9 15:56:40 2018 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/helix/common/DedupEventProcessor.java | 2 +-
.../main/java/org/apache/helix/messaging/handling/HelixTask.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/a9cdecc6/helix-core/src/main/java/org/apache/helix/common/DedupEventProcessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/common/DedupEventProcessor.java b/helix-core/src/main/java/org/apache/helix/common/DedupEventProcessor.java
index 942b021..10e3b00 100644
--- a/helix-core/src/main/java/org/apache/helix/common/DedupEventProcessor.java
+++ b/helix-core/src/main/java/org/apache/helix/common/DedupEventProcessor.java
@@ -49,7 +49,7 @@ public abstract class DedupEventProcessor<T, E> extends Thread {
} catch (ThreadDeath death) {
throw death;
} catch (Throwable t) {
- logger.error(_processorName + " thread failed while running the controller pipeline", t);
+ logger.error(_processorName + " thread failed while running " + _processorName, t);
}
}
logger.info("END " + _processorName + " thread for cluster " + _clusterName);
http://git-wip-us.apache.org/repos/asf/helix/blob/a9cdecc6/helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTask.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTask.java b/helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTask.java
index 3cca883..0738ef9 100644
--- a/helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTask.java
+++ b/helix-core/src/main/java/org/apache/helix/messaging/handling/HelixTask.java
@@ -255,7 +255,7 @@ public class HelixTask implements MessageTask {
if (!success) {
logger.warn("Failed to send relay message " + msg.getId() + " to " + instance);
} else {
- logger.info("Send relay message " + message.getId() + " to " + instance);
+ logger.info("Send relay message " + msg.getId() + " to " + instance);
}
}
}
[3/4] helix git commit: Fix Partition level priority test fail
Posted by jx...@apache.org.
Fix Partition level priority test fail
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/a979f352
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/a979f352
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/a979f352
Branch: refs/heads/master
Commit: a979f3522dd3f6fe7345829e960200f87e58f031
Parents: d18e779
Author: Junkai Xue <jx...@linkedin.com>
Authored: Thu May 24 16:53:44 2018 -0700
Committer: Junkai Xue <jx...@jxue-mn2.linkedin.biz>
Committed: Mon Jul 9 15:56:40 2018 -0700
----------------------------------------------------------------------
.../helix/controller/stages/TestStateTransitionPrirority.java | 2 +-
helix-core/src/test/resources/TestPartitionLevelPriority.json | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/a979f352/helix-core/src/test/java/org/apache/helix/controller/stages/TestStateTransitionPrirority.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestStateTransitionPrirority.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestStateTransitionPrirority.java
index 9bb5cf0..2abb3be 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestStateTransitionPrirority.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestStateTransitionPrirority.java
@@ -149,7 +149,7 @@ public class TestStateTransitionPrirority extends BaseStageTest {
// Add load rebalance throttle config
ClusterConfig clusterConfig = accessor.getProperty(accessor.keyBuilder().clusterConfig());
StateTransitionThrottleConfig throttleConfigForLoadRebalance =
- new StateTransitionThrottleConfig(StateTransitionThrottleConfig.RebalanceType.LOAD_BALANCE,
+ new StateTransitionThrottleConfig(StateTransitionThrottleConfig.RebalanceType.ANY,
StateTransitionThrottleConfig.ThrottleScope.CLUSTER, 1);
List<StateTransitionThrottleConfig> currentThrottleConfig =
clusterConfig.getStateTransitionThrottleConfigs();
http://git-wip-us.apache.org/repos/asf/helix/blob/a979f352/helix-core/src/test/resources/TestPartitionLevelPriority.json
----------------------------------------------------------------------
diff --git a/helix-core/src/test/resources/TestPartitionLevelPriority.json b/helix-core/src/test/resources/TestPartitionLevelPriority.json
index 1b299ee..974f985 100644
--- a/helix-core/src/test/resources/TestPartitionLevelPriority.json
+++ b/helix-core/src/test/resources/TestPartitionLevelPriority.json
@@ -77,8 +77,8 @@
"Partition_2",
"Partition_3",
"Partition_1",
- "Partition_4",
- "Partition_0"
+ "Partition_0",
+ "Partition_4"
]
},
{
[4/4] helix git commit: Fix TestZkConnectionLost to use seperate zk
server to avoid stuck other tests.
Posted by jx...@apache.org.
Fix TestZkConnectionLost to use seperate zk server to avoid stuck other tests.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/aaa632f3
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/aaa632f3
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/aaa632f3
Branch: refs/heads/master
Commit: aaa632f3d53a0268bfbf1b7ed18996cdc72894a4
Parents: 2049f93
Author: Lei Xia <lx...@linkedin.com>
Authored: Thu May 17 13:29:31 2018 -0700
Committer: Junkai Xue <jx...@jxue-mn2.linkedin.biz>
Committed: Mon Jul 9 15:56:40 2018 -0700
----------------------------------------------------------------------
.../helix/integration/TestZkConnectionLost.java | 22 ++++++++--------
.../helix/task/TaskSynchronizedTestBase.java | 27 +++++++++++++++++---
2 files changed, 35 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/aaa632f3/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
index 6fb966e..3721b2c 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
@@ -34,30 +34,33 @@ public class TestZkConnectionLost extends TaskTestBase {
private final AtomicReference<ZkServer> _zkServerRef = new AtomicReference<>();
+ private String _zkAddr = "localhost:2189";
+
@BeforeClass
public void beforeClass() throws Exception {
+ ZkServer zkServer = TestHelper.startZkServer(_zkAddr);
+ _zkServerRef.set(zkServer);
+
_participants = new MockParticipantManager[_numNodes];
String namespace = "/" + CLUSTER_NAME;
if (_gZkClient.exists(namespace)) {
_gZkClient.deleteRecursively(namespace);
}
- _setupTool = new ClusterSetup(ZK_ADDR);
+ _setupTool = new ClusterSetup(_zkAddr);
_setupTool.addCluster(CLUSTER_NAME, true);
setupParticipants();
setupDBs();
- createManagers();
+ createManagers(_zkAddr, CLUSTER_NAME);
// start controller
String controllerName = CONTROLLER_PREFIX + "_0";
- _controller = new ClusterControllerManager(ZK_ADDR, CLUSTER_NAME, controllerName);
+ _controller = new ClusterControllerManager(_zkAddr, CLUSTER_NAME, controllerName);
_controller.syncStart();
HelixClusterVerifier clusterVerifier =
- new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkAddr(ZK_ADDR).build();
+ new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkAddr(_zkAddr).build();
Assert.assertTrue(clusterVerifier.verify());
-
- _zkServerRef.set(_zkServer);
}
@Test
@@ -66,7 +69,7 @@ public class TestZkConnectionLost extends TaskTestBase {
System.setProperty("zk.session.timeout", "1000");
String queueName = TestHelper.getTestMethodName();
- startParticipants();
+ startParticipants(_zkAddr);
// Create a queue
LOG.info("Starting job-queue: " + queueName);
@@ -78,7 +81,6 @@ public class TestZkConnectionLost extends TaskTestBase {
restartZkServer();
WorkflowContext wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
- // ensure job 1 is started before stop it
String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
_driver.pollForWorkflowState(scheduledQueue, 10000, TaskState.COMPLETED);
}
@@ -91,7 +93,7 @@ public class TestZkConnectionLost extends TaskTestBase {
String queueName = TestHelper.getTestMethodName();
stopParticipants();
- startParticipants();
+ startParticipants(_zkAddr);
LOG.info("Starting job-queue: " + queueName);
JobQueue.Builder queueBuild = TaskTestUtil.buildRecurrentJobQueue(queueName, 0, 6000);
@@ -124,7 +126,7 @@ public class TestZkConnectionLost extends TaskTestBase {
TestHelper.stopZkServer(_zkServerRef.get());
Thread.sleep(300);
System.out.println("Restart ZK server");
- _zkServerRef.set(TestHelper.startZkServer(ZK_ADDR, null, false));
+ _zkServerRef.set(TestHelper.startZkServer(_zkAddr, null, false));
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
http://git-wip-us.apache.org/repos/asf/helix/blob/aaa632f3/helix-core/src/test/java/org/apache/helix/task/TaskSynchronizedTestBase.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/task/TaskSynchronizedTestBase.java b/helix-core/src/test/java/org/apache/helix/task/TaskSynchronizedTestBase.java
index c377233..cab60ce 100644
--- a/helix-core/src/test/java/org/apache/helix/task/TaskSynchronizedTestBase.java
+++ b/helix-core/src/test/java/org/apache/helix/task/TaskSynchronizedTestBase.java
@@ -121,16 +121,30 @@ public class TaskSynchronizedTestBase extends ZkIntegrationTestBase {
}
protected void startParticipants() {
- startParticipants(_numNodes);
+ startParticipants(ZK_ADDR, _numNodes);
+ }
+
+ protected void startParticipants(String zkAddr) {
+ startParticipants(zkAddr, _numNodes);
}
protected void startParticipants(int numNodes) {
for (int i = 0; i < numNodes; i++) {
- startParticipant(i);
+ startParticipant(ZK_ADDR, i);
+ }
+ }
+
+ protected void startParticipants(String zkAddr, int numNodes) {
+ for (int i = 0; i < numNodes; i++) {
+ startParticipant(zkAddr, i);
}
}
protected void startParticipant(int i) {
+ startParticipant(ZK_ADDR, i);
+ }
+
+ protected void startParticipant(String zkAddr, int i) {
Map<String, TaskFactory> taskFactoryReg = new HashMap<String, TaskFactory>();
taskFactoryReg.put(MockTask.TASK_COMMAND, new TaskFactory() {
@Override public Task createNewTask(TaskCallbackContext context) {
@@ -138,7 +152,7 @@ public class TaskSynchronizedTestBase extends ZkIntegrationTestBase {
}
});
String instanceName = PARTICIPANT_PREFIX + "_" + (_startPort + i);
- _participants[i] = new MockParticipantManager(ZK_ADDR, CLUSTER_NAME, instanceName);
+ _participants[i] = new MockParticipantManager(zkAddr, CLUSTER_NAME, instanceName);
// Register a Task state model factory.
StateMachineEngine stateMachine = _participants[i].getStateMachineEngine();
@@ -165,12 +179,17 @@ public class TaskSynchronizedTestBase extends ZkIntegrationTestBase {
protected void createManagers() throws Exception {
+ createManagers(ZK_ADDR, CLUSTER_NAME);
+ }
+
+ protected void createManagers(String zkAddr, String clusterName) throws Exception {
_manager = HelixManagerFactory
- .getZKHelixManager(CLUSTER_NAME, "Admin", InstanceType.ADMINISTRATOR, ZK_ADDR);
+ .getZKHelixManager(clusterName, "Admin", InstanceType.ADMINISTRATOR, zkAddr);
_manager.connect();
_driver = new TaskDriver(_manager);
}
+
public void setSingleTestEnvironment() {
_numDbs = 1;
_numNodes = 1;
[2/4] helix git commit: Fix reset partition REST command.
Posted by jx...@apache.org.
Fix reset partition REST command.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/d18e779e
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/d18e779e
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/d18e779e
Branch: refs/heads/master
Commit: d18e779eb529be04b0a5c5d3fd0cf26ff40f6182
Parents: aaa632f
Author: Lei Xia <lx...@linkedin.com>
Authored: Sat May 12 21:31:23 2018 -0700
Committer: Junkai Xue <jx...@jxue-mn2.linkedin.biz>
Committed: Mon Jul 9 15:56:40 2018 -0700
----------------------------------------------------------------------
.../org/apache/helix/rest/server/resources/AbstractResource.java | 1 +
.../helix/rest/server/resources/helix/InstanceAccessor.java | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/helix/blob/d18e779e/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
index e3c565d..dca0852 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/AbstractResource.java
@@ -73,6 +73,7 @@ public class AbstractResource {
delete,
rebalance,
reset,
+ resetPartitions,
removeInstanceTag
}
http://git-wip-us.apache.org/repos/asf/helix/blob/d18e779e/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
----------------------------------------------------------------------
diff --git a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
index 31be5cf..98af0ee 100644
--- a/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
+++ b/helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstanceAccessor.java
@@ -230,12 +230,14 @@ public class InstanceAccessor extends AbstractHelixResource {
case disable:
admin.enableInstance(clusterId, instanceName, false);
break;
+
case reset:
+ case resetPartitions:
if (!validInstance(node, instanceName)) {
return badRequest("Instance names are not match!");
}
admin.resetPartition(clusterId, instanceName,
- node.get(InstanceProperties.resource.name()).toString(), (List<String>) OBJECT_MAPPER
+ node.get(InstanceProperties.resource.name()).getTextValue(), (List<String>) OBJECT_MAPPER
.readValue(node.get(InstanceProperties.partitions.name()).toString(),
OBJECT_MAPPER.getTypeFactory()
.constructCollectionType(List.class, String.class)));