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 2020/07/29 07:19:41 UTC

[GitHub] [flink] pnowojski opened a new pull request #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

pnowojski opened a new pull request #13008:
URL: https://github.com/apache/flink/pull/13008


    `checkpointStartDelayNanos` for `SourceStreamTask` can be measured how long did it take for the checkpoint triggering RPC call to finally start executing inside the mailbox thread. If the mailbox is busy, for example SourceFunction is backpressured, this time can be quite significant.
   
   This PR also simplifies `MultipleInputStreamTaskTestHarnessBuilder`.
   
   ## Brief change log
   
   This change added new test to cover for new metric.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **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.

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



[GitHub] [flink] flinkbot commented on pull request #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

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






----------------------------------------------------------------
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] rkhachatryan commented on a change in pull request #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -217,6 +217,8 @@
 
 	private Long syncSavepointId = null;
 
+	private long latestAsyncCheckpointStartDelayNanos;

Review comment:
       Shouldn't this field be `volatile`?

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -791,6 +793,9 @@ public StreamStatusMaintainer getStreamStatusMaintainer() {
 		CompletableFuture<Boolean> result = new CompletableFuture<>();
 		mainMailboxExecutor.execute(
 				() -> {
+					latestAsyncCheckpointStartDelayNanos = 1_000_000 * Math.max(

Review comment:
       During the offline discussion, it seemed the right thing to update the metric here.
   But now I'm wondering,  isn't it too late to update it here?
   
   If the 1st checkpoint is delayed for 1 hour, then the metric will report zero-delay for this one hour, right? Is it an issue?
   
   I see the following way to solve this:
   1. introduce `pendingCheckpointTimestamp`
   1. upon receiving RPC call, update `pendingCheckpointTimestamp` it from cp metadata and reset `latestDelay`
   1. upon starting checkpoint, do the opposite: reset `pendingCheckpointTimestamp` and update `latestDelay`
   1. in `getAsyncCheckpointStartDelayNanos` report  `now() - pendingCheckpointTimestamp` or `latestDelay` depending on what is set
   
   (probably need to adjust for multiple concurrent checkpoints)

##########
File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/MultipleInputStreamTaskTestHarnessBuilder.java
##########
@@ -1,108 +0,0 @@
-/*
- * 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.streaming.runtime.tasks;
-
-import org.apache.flink.api.common.typeinfo.TypeInformation;
-import org.apache.flink.api.common.typeutils.TypeSerializer;
-import org.apache.flink.api.java.functions.KeySelector;
-import org.apache.flink.runtime.execution.Environment;
-import org.apache.flink.runtime.io.network.partition.consumer.StreamTestSingleInputGate;
-import org.apache.flink.streaming.api.graph.StreamEdge;
-import org.apache.flink.streaming.api.graph.StreamNode;
-import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
-import org.apache.flink.streaming.api.operators.StreamOperator;
-import org.apache.flink.streaming.runtime.partitioner.BroadcastPartitioner;
-import org.apache.flink.util.function.FunctionWithException;
-
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Builder to create a {@link StreamTaskMailboxTestHarness} to test {@link MultipleInputStreamTask}.
- */
-public class MultipleInputStreamTaskTestHarnessBuilder<OUT> extends StreamTaskMailboxTestHarnessBuilder<OUT> {

Review comment:
       :+1: :+1: :+1: :smile: 




----------------------------------------------------------------
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] pnowojski commented on pull request #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

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


   Merging as test failure is unrelated


----------------------------------------------------------------
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 #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

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






----------------------------------------------------------------
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] pnowojski merged pull request #13008: [FLINK-18656][task] Provide checkpointStartDelayNanos for SourceStreamTask

Posted by GitBox <gi...@apache.org>.
pnowojski merged pull request #13008:
URL: https://github.com/apache/flink/pull/13008


   


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