You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/01/04 16:11:24 UTC

[GitHub] [flink] tillrohrmann opened a new pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

tillrohrmann opened a new pull request #14553:
URL: https://github.com/apache/flink/pull/14553


   In order to support reusing checkpoints across different `ExecutionGraph` instances, this PR decouples the checkpoint services `CompletedCheckpointStore` and `CheckpointIDCounter` from the lifetime of the `CheckpointCoordinator`. Concretely, this means that these services won't be shut down by the `CheckpointCoordinator` but by an instance which can live longer than the `CheckpointCoordinator`. The current owner of the checkpoint services is the `SchedulerBase`.
   
   * 7e2af0e Factor out CompletedCheckpointStore and CheckpointIDCounter creation in ExecutionGraphBuilder.buildGraph
   * ab4b146 Move CheckpointIDCounter creation out of ExecutionGraphBuilder
   * c5b6e2c Move CompletedCheckpointStore creation out of ExecutionGraphBuilder.buildGraph
   * 040cffc Remove CheckpointRecoveryFactory from ExecutionGraphBuilder.buildGraph
   * fa3309b Move checkpoint service shut down out of CheckpointCoordinator 


----------------------------------------------------------------
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



[GitHub] [flink] flinkbot edited a comment on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754074657


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622",
       "triggerID" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot commented on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754067538


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 (Mon Jan 04 16:14:09 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </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.

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



[GitHub] [flink] tillrohrmann commented on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754545450


   Thanks for the review @zentol. I've addressed your comments and pushed an update. Merging once AZP gives green light.


----------------------------------------------------------------
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



[GitHub] [flink] zentol commented on a change in pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #14553:
URL: https://github.com/apache/flink/pull/14553#discussion_r551487858



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphDeploymentTest.java
##########
@@ -742,25 +731,11 @@ private ExecutionGraph createExecutionGraph(Configuration configuration) throws
                                 0),
                         null));
 
-        final Time timeout = Time.seconds(10L);
-        return ExecutionGraphBuilder.buildGraph(
-                null,
-                jobGraph,
-                configuration,
-                executor,
-                executor,
-                new ProgrammedSlotProvider(1),

Review comment:
       Seems like this was the only remaining usage of the `ProgrammedSlotProvider`.

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerUtils.java
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.scheduler;
+
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.configuration.CheckpointingOptions;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.runtime.checkpoint.CheckpointIDCounter;
+import org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory;
+import org.apache.flink.runtime.checkpoint.CompletedCheckpointStore;
+import org.apache.flink.runtime.checkpoint.DeactivatedCheckpointCompletedCheckpointStore;
+import org.apache.flink.runtime.checkpoint.DeactivatedCheckpointIDCounter;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraphBuilder;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+
+import org.slf4j.Logger;
+
+/** Utils class for Flink's scheduler implementations. */
+public final class SchedulerUtils {
+
+    private SchedulerUtils() {
+        throw new UnsupportedOperationException(
+                "Instantiation of SchedulerUtils is not supported.");
+    }
+
+    public static CompletedCheckpointStore createCompletedCheckpointStoreIfCheckpointingIsEnabled(
+            JobGraph jobGraph,
+            Configuration configuration,
+            ClassLoader userCodeLoader,
+            CheckpointRecoveryFactory checkpointRecoveryFactory,
+            Logger log)
+            throws JobExecutionException {
+        final JobID jobId = jobGraph.getJobID();
+        if (ExecutionGraphBuilder.isCheckpointingEnabled(jobGraph)) {
+            try {
+                return createCompletedCheckpointStore(
+                        configuration, userCodeLoader, checkpointRecoveryFactory, log, jobId);
+            } catch (Exception e) {
+                throw new JobExecutionException(
+                        jobId,
+                        "Failed to initialize high-availability completed checkpoint store",
+                        e);
+            }
+        } else {
+            return DeactivatedCheckpointCompletedCheckpointStore.INSTANCE;
+        }
+    }
+
+    static CompletedCheckpointStore createCompletedCheckpointStore(

Review comment:
       `@VisibleForTesting`?




----------------------------------------------------------------
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



[GitHub] [flink] flinkbot commented on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754074657


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] tillrohrmann closed pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
tillrohrmann closed pull request #14553:
URL: https://github.com/apache/flink/pull/14553


   


----------------------------------------------------------------
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



[GitHub] [flink] tillrohrmann commented on a change in pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #14553:
URL: https://github.com/apache/flink/pull/14553#discussion_r551836428



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphDeploymentTest.java
##########
@@ -742,25 +731,11 @@ private ExecutionGraph createExecutionGraph(Configuration configuration) throws
                                 0),
                         null));
 
-        final Time timeout = Time.seconds(10L);
-        return ExecutionGraphBuilder.buildGraph(
-                null,
-                jobGraph,
-                configuration,
-                executor,
-                executor,
-                new ProgrammedSlotProvider(1),

Review comment:
       Oh yes, good catch. I'll remove it :-)




----------------------------------------------------------------
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



[GitHub] [flink] tillrohrmann commented on a change in pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #14553:
URL: https://github.com/apache/flink/pull/14553#discussion_r551837596



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SchedulerUtils.java
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.scheduler;
+
+import org.apache.flink.api.common.JobID;
+import org.apache.flink.configuration.CheckpointingOptions;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.runtime.checkpoint.CheckpointIDCounter;
+import org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory;
+import org.apache.flink.runtime.checkpoint.CompletedCheckpointStore;
+import org.apache.flink.runtime.checkpoint.DeactivatedCheckpointCompletedCheckpointStore;
+import org.apache.flink.runtime.checkpoint.DeactivatedCheckpointIDCounter;
+import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.executiongraph.ExecutionGraphBuilder;
+import org.apache.flink.runtime.jobgraph.JobGraph;
+
+import org.slf4j.Logger;
+
+/** Utils class for Flink's scheduler implementations. */
+public final class SchedulerUtils {
+
+    private SchedulerUtils() {
+        throw new UnsupportedOperationException(
+                "Instantiation of SchedulerUtils is not supported.");
+    }
+
+    public static CompletedCheckpointStore createCompletedCheckpointStoreIfCheckpointingIsEnabled(
+            JobGraph jobGraph,
+            Configuration configuration,
+            ClassLoader userCodeLoader,
+            CheckpointRecoveryFactory checkpointRecoveryFactory,
+            Logger log)
+            throws JobExecutionException {
+        final JobID jobId = jobGraph.getJobID();
+        if (ExecutionGraphBuilder.isCheckpointingEnabled(jobGraph)) {
+            try {
+                return createCompletedCheckpointStore(
+                        configuration, userCodeLoader, checkpointRecoveryFactory, log, jobId);
+            } catch (Exception e) {
+                throw new JobExecutionException(
+                        jobId,
+                        "Failed to initialize high-availability completed checkpoint store",
+                        e);
+            }
+        } else {
+            return DeactivatedCheckpointCompletedCheckpointStore.INSTANCE;
+        }
+    }
+
+    static CompletedCheckpointStore createCompletedCheckpointStore(

Review comment:
       Yes, you are right. I'll update it. 




----------------------------------------------------------------
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



[GitHub] [flink] flinkbot edited a comment on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754074657


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622",
       "triggerID" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cf21f3742da38806bbb374ff78dabfa7ce7d6396",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11647",
       "triggerID" : "cf21f3742da38806bbb374ff78dabfa7ce7d6396",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622) 
   * cf21f3742da38806bbb374ff78dabfa7ce7d6396 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11647) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754074657


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622",
       "triggerID" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cf21f3742da38806bbb374ff78dabfa7ce7d6396",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cf21f3742da38806bbb374ff78dabfa7ce7d6396",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622) 
   * cf21f3742da38806bbb374ff78dabfa7ce7d6396 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754074657


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622",
       "triggerID" : "b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b98fae5ddc22f64ce6aecd5ad667fd75aa8dda62 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11622) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@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.

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



[GitHub] [flink] flinkbot edited a comment on pull request #14553: [FLINK-20846] Decouple checkpoint services and CheckpointCoordinator

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14553:
URL: https://github.com/apache/flink/pull/14553#issuecomment-754067538


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit cf21f3742da38806bbb374ff78dabfa7ce7d6396 (Fri May 28 07:00:52 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </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.

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