You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/12/09 17:29:10 UTC

[GitHub] [helix] alirezazamani opened a new pull request #1583: Fix redundant workflow context updates for finised workflows

alirezazamani opened a new pull request #1583:
URL: https://github.com/apache/helix/pull/1583


   ### Issues
   
   - [X] My PR addresses the following Helix issues and references them in the PR description:
   Fixes #1582 
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   If the workflow has been finished before, there is no need to update the workflow context.
   In this PR, this behavior has been fixed and optimized.
   
   ### Tests
   
   - [x] The following tests are written for this issue:
   TestContextRedundantUpdates
   More test will be added to this file as we move toward reducing context writes
   
   - [x] The following is the result of the "mvn test" command on the appropriate module:
   Helix-core:
   ```
   [INFO] Tests run: 1253, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5,396.908 s - in TestSuite
   [INFO] 
   [INFO] Results:
   [INFO] 
   [INFO] Tests run: 1253, Failures: 0, Errors: 0, Skipped: 0
   [INFO] 
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  01:30 h
   [INFO] Finished at: 2020-12-09T00:16:20-08:00
   [INFO] ------------------------------------------------------------------------
   ```
   The failed test is unrelated to this change and is failing even without this PR.
   
   Helix-rest:
   ```
   [INFO] Tests run: 171, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 103.579 s - in TestSuite
   [INFO] 
   [INFO] Results:
   [INFO] 
   [INFO] Tests run: 171, Failures: 0, Errors: 0, Skipped: 0
   [INFO] 
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  01:49 min
   [INFO] Finished at: 2020-12-09T09:28:35-08:00
   [INFO] ------------------------------------------------------------------------
   ```
   
   ### Commits
   
   - My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Code Quality
   
   - My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] alirezazamani commented on pull request #1583: Fix redundant workflow context updates for finished workflows

Posted by GitBox <gi...@apache.org>.
alirezazamani commented on pull request #1583:
URL: https://github.com/apache/helix/pull/1583#issuecomment-742154219


   This PR is ready to be merged.
   
   Final commit message:
   Fix redundant workflow context updates for finished workflows
   
   If the workflow has been finished, there is no need to update the workflow context.
   In this commit, this behavior has been fixed and optimized.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] alirezazamani merged pull request #1583: Fix redundant workflow context updates for finished workflows

Posted by GitBox <gi...@apache.org>.
alirezazamani merged pull request #1583:
URL: https://github.com/apache/helix/pull/1583


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] alirezazamani commented on a change in pull request #1583: Fix redundant workflow context updates for finished workflows

Posted by GitBox <gi...@apache.org>.
alirezazamani commented on a change in pull request #1583:
URL: https://github.com/apache/helix/pull/1583#discussion_r539528994



##########
File path: helix-core/src/test/java/org/apache/helix/integration/task/TestContextRedundantUpdates.java
##########
@@ -0,0 +1,85 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * This test checks of the workflow and job context get updates only if the update is necessary
+ */
+public class TestContextRedundantUpdates extends TaskTestBase {

Review comment:
       More test will be added to this file as we move toward reducing context writes

##########
File path: helix-core/src/test/java/org/apache/helix/integration/task/TestContextRedundantUpdates.java
##########
@@ -0,0 +1,85 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * This test checks of the workflow and job context get updates only if the update is necessary
+ */
+public class TestContextRedundantUpdates extends TaskTestBase {

Review comment:
       More tests will be added to this file as we move toward reducing context writes




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] alirezazamani commented on a change in pull request #1583: Fix redundant workflow context updates for finised workflows

Posted by GitBox <gi...@apache.org>.
alirezazamani commented on a change in pull request #1583:
URL: https://github.com/apache/helix/pull/1583#discussion_r539503790



##########
File path: helix-core/src/main/java/org/apache/helix/task/WorkflowDispatcher.java
##########
@@ -217,7 +217,6 @@ public void assignWorkflow(String workflow, WorkflowConfig workflowCfg,
     } else {
       LOG.debug("Workflow {} is not ready to be scheduled.", workflow);
     }
-    _clusterDataCache.updateWorkflowContext(workflow, workflowCtx);

Review comment:
       This update is not necessary. When there is a job that needs to be scheduled, we update the workflow context there. If there is no job, then we do not need to update the workflow context




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org