lindong28 commented on code in PR #22670:
URL: https://github.com/apache/flink/pull/22670#discussion_r1246792310


##########
flink-runtime/src/main/java/org/apache/flink/runtime/sink/coordinator/SinkCoordinator.java:
##########
@@ -0,0 +1,158 @@
+/*
+ * 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.sink.coordinator;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.jobgraph.OperatorID;
+import org.apache.flink.runtime.operators.coordination.CoordinatorStore;
+import org.apache.flink.runtime.operators.coordination.OperatorCoordinator;
+import org.apache.flink.runtime.operators.coordination.OperatorEvent;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Nullable;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * The default implementation of the {@link OperatorCoordinator} for the {@link
+ * org.apache.flink.api.connector.sink2.Sink}.
+ *
+ * <p>The <code>SinkCoordinator</code> helps trigger an immediate global 
checkpoint when all sink
+ * operators are reaching end of data.
+ */
+@Internal
+public class SinkCoordinator implements OperatorCoordinator {

Review Comment:
   > How do you know that no part of the system is doing something that 
shouldn't happen after the task started to wait for the checkpoint? If we just 
closed our eyes and assumed there to not be a problem, well then that is quite 
a red flag.
   
   I am sure we can always find more benefits of doing some extra work. The 
question is whether the benefit outweighs the cost (e.g. extra code complexity) 
and whether its priority is higher (for both the community and the volunteer 
who offered to improve Flink open source code).
   
   The scope of FLINK-28386 is to prevent tasks having to wait for a 
checkpoint. While I agree it might beneficial for the adaptive scheduler to not 
scale up the job, and to provide metrics capturing how much time operators 
spend idling waiting for that next checkpoint, this is strictly speaking out of 
the scope of this PR. It might be reasonable to allow community developers to 
make incremental progress.
   
   As far as FLINK-28386's goal is concerned, do you see a better approach to 
achieve this goal, or do you see any performance or correctness issue with the 
current 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to