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:
[email protected]