You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "FangYongs (via GitHub)" <gi...@apache.org> on 2023/07/28 08:37:46 UTC
[GitHub] [flink] FangYongs opened a new pull request, #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
FangYongs opened a new pull request, #23101:
URL: https://github.com/apache/flink/pull/23101
## What is the purpose of the change
This PR aims to not save job which without restart strategy to job writer and store.
In olap scenario, jobs always has no restart strategy. It will increase latency if the jobs are saved to zookeeper or configmap for k8s. It is not necessary for the jobs without restart strategy to save these information.
## Brief change log
- Add DispatcherJobStorage for Dispatcher to manage job writer and store
- Register job to DispatcherJobStorage if it has no restart strategy
- Do not save job information if job has no restart strategy
- Unregister job in DispatcherJobStorage when job reaches termination
## Verifying this change
This change added tests and can be verified as follows:
- Added `testCleanupWhenJobFinishedWithNoRestart` and `testCleanupWhenJobCanceledWithNoRestart` to test register and unregister in Dispatcher
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no) no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no) no
- The serializers: (yes / no / don't know) no
- The runtime per-record code paths (performance sensitive): (yes / no / don't know) no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
- The S3 file system connector: (yes / no / don't know) no
## Documentation
- Does this pull request introduce a new feature? (yes / no) no
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store [flink]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-2595364277
This PR is being marked as stale since it has not had any activity in the last 180 days.
If you would like to keep this PR alive, please leave a comment asking for a review.
If the PR has merge conflicts, update it with the latest from the base branch.
If you are having difficulty finding a reviewer, please reach out to the
community, contact details can be found here: https://flink.apache.org/what-is-flink/community/
If this PR is no longer valid or desired, please feel free to close it.
If no activity occurs in the next 90 days, it will be automatically closed.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] XComp commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1658366241
I'm wondering whether you're doing too much here: Aren't you just interested in not adding the `JobGraph` to the `JobGraphStore`? What about coming up with a custom implementation of `JobGraphWriter` that filters out jobs in `JobGraphWriter#putJobGraph` that serves as a wrapper around another `JobGraphWriter` instance and deals with the filtering of `JobGraph`.
Additionally, I'm not sure whether you want to filter out `JobResourceRequirements` updates. I feel like we want the request to fail if the user accidentally requested the rescaling for a job that is not allowed to rescale. :thinking:
For the `JobResultStore`, I'd argue that we're not gaining much because the `JobResultStore` is used at the end of the job's lifecycle sending only some requests to S3.
In this sense, I feel like we don't need to introduce yet another component in the `Dispatcher` codebase but rather rely on the `JobGraphWriter` interface for this. WDYT?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1655290894
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "9e88a35aafee8645ebbabb3225b24fa8052b4bcd",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9e88a35aafee8645ebbabb3225b24fa8052b4bcd",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9e88a35aafee8645ebbabb3225b24fa8052b4bcd UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] FangYongs commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "FangYongs (via GitHub)" <gi...@apache.org>.
FangYongs commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1663633754
Hi @XComp I have updated this PR according to our discussion above, please help to review it again when you're free, thanks :)
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] XComp commented on a diff in pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on code in PR #23101:
URL: https://github.com/apache/flink/pull/23101#discussion_r1283041203
##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/DelegateJobGraphStore.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+package org.apache.flink.runtime.jobmanager;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+import org.apache.flink.runtime.jobgraph.JobResourceRequirements;
+
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+
+import static org.apache.flink.runtime.executiongraph.failover.flip1.FailoverStrategyFactoryLoader.isJobRestartDisable;
+
+/** Delegate for job graph store with filter for job without restart strategy. */
+public class DelegateJobGraphStore implements JobGraphStore {
Review Comment:
I feel the name could be more meaningful: `FilteringJobGraphStore` might be an option?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/FailoverStrategyFactoryLoader.java:
##########
@@ -59,4 +60,20 @@ public static FailoverStrategy.Factory loadFailoverStrategyFactory(final Configu
"Unknown failover strategy: " + strategyParam);
}
}
+
+ public static boolean isJobRestartDisable(final Configuration configuration) {
Review Comment:
`RestartStrategyOptions.RESTART_STRATEGY` is covered by [RestartBackoffTimeStrategyFactoryLoader](https://github.com/apache/flink/blob/13b7b3e6050ee716d01c9d3d74d08702f93953a8/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/RestartBackoffTimeStrategyFactoryLoader.java). `FailoverStrategy` is probably the wrong location for this method.
##########
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/DispatcherResourceCleanupTest.java:
##########
@@ -83,30 +86,27 @@
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
-import static org.apache.flink.core.testutils.FlinkMatchers.containsCause;
-import static org.apache.flink.core.testutils.FlinkMatchers.containsMessage;
import static org.apache.flink.runtime.dispatcher.AbstractDispatcherTest.awaitStatus;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
Review Comment:
Thanks for migrating this class to JUnit5. Could you move that into a separate commit?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/DelegateJobGraphStore.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+package org.apache.flink.runtime.jobmanager;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+import org.apache.flink.runtime.jobgraph.JobResourceRequirements;
+
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+
+import static org.apache.flink.runtime.executiongraph.failover.flip1.FailoverStrategyFactoryLoader.isJobRestartDisable;
+
+/** Delegate for job graph store with filter for job without restart strategy. */
+public class DelegateJobGraphStore implements JobGraphStore {
Review Comment:
I'm wondering whether we should just move this functionality into `DefaultJobGraphStore`. We only need it in the HA scenario, i.e. only when using the `DefaultJobGraphStore`. The filtering does not require that much extra functionality that it would deserve a separate class. WDYT? :thinking:
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] FangYongs commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "FangYongs (via GitHub)" <gi...@apache.org>.
FangYongs commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1665209198
Thanks @XComp , I agree with you that we need to validate the restart strategy with the job configuration and cluster configuration together, I'll update this PR 👍
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] FangYongs commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "FangYongs (via GitHub)" <gi...@apache.org>.
FangYongs commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1655287731
Hi @XComp @zentol Could you help to review this PR when you're free? Thanks
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] FangYongs commented on pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
Posted by "FangYongs (via GitHub)" <gi...@apache.org>.
FangYongs commented on PR #23101:
URL: https://github.com/apache/flink/pull/23101#issuecomment-1661439688
Thanks @XComp for you advice. I have carefully considered it and I think your approach is much better! I have found that the current method, in addition to the issues you mentioned, will also cause many testing errors because it is not compatible enough with the saving and deleting jobgraph. I will update this PR to use a delegate implementation for `JobGraphWriter`.
For `JobResultStore`, it will be used in `Dispatcher` and `JobMasterServiceLeadershipRunner` to check whether there's duplicate job for given id, and then save job information to filesystem after it reaches terminations. I agree with you that we can consider it when it really been an issue later.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store [flink]
Posted by "FangYongs (via GitHub)" <gi...@apache.org>.
FangYongs closed pull request #23101: [FLINK-32667][dispatcher] Do not save job without restart strategy to job writer and store
URL: https://github.com/apache/flink/pull/23101
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org