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 2022/06/26 08:04:49 UTC

[GitHub] [flink] 1996fanrui opened a new pull request, #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

1996fanrui opened a new pull request, #20075:
URL: https://github.com/apache/flink/pull/20075

   ## What is the purpose of the change
   
   Disable overdraft buffer for LegacySource.
   
   ## Brief change log
   
   Disable overdraft buffer for LegacySource.
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? 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


[GitHub] [flink] pnowojski commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
pnowojski commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r907295817


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -385,11 +385,16 @@ public Task(
                 shuffleEnvironment.createShuffleIOOwnerContext(
                         taskNameWithSubtaskAndId, executionId, metrics.getIOMetricGroup());
 
+        boolean overdraftBufferEnabled =
+                !nameOfInvokableClass.equals(
+                        "org.apache.flink.streaming.runtime.tasks.SourceStreamTask");

Review Comment:
   I wonder if it would have been better to have:
   
   -  `LocalBufferPool#maxOverdraftBuffersPerGate` mutable (non-final)
   - provide setter `LocalBufferPool#setMaxOverdraftBuffers`
   - call this setter from within `SourceStreamTask`
   
   ? 



-- 
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 #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cf09ed60bd0b072ca87e659d37295762d5595582",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cf09ed60bd0b072ca87e659d37295762d5595582",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cf09ed60bd0b072ca87e659d37295762d5595582 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] pnowojski merged pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

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


-- 
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] pnowojski commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
pnowojski commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r909420150


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java:
##########
@@ -164,6 +164,7 @@ public void triggerCheckpoint(long checkpointId) throws FlinkException {
                 .gauge(
                         MetricNames.CHECKPOINT_START_DELAY_TIME,
                         this::getAsyncCheckpointStartDelayNanos);
+        recordWriter.setMaxOverdraftBuffersPerGate(0);

Review Comment:
   Could you add a unit test for this? I think it could look similar to `SourceStreamTaskTest#testTriggeringCheckpointAfterSourceThreadFinished` but vastly simplified:
   
   1. Create a single additional `ResultPartition`
   2. assert `resultPartition.getBufferPool().getMaxOverdraftBuffersPerGate() > 0`
   3. Construct `SourceStreamTask` via `StreamTaskMailboxTestHarnessBuilder`
   4. assert `resultPartition.getBufferPool().getMaxOverdraftBuffersPerGate() == 0`
    
   ?



-- 
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] 1996fanrui commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r909520354


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SourceStreamTask.java:
##########
@@ -164,6 +164,7 @@ public void triggerCheckpoint(long checkpointId) throws FlinkException {
                 .gauge(
                         MetricNames.CHECKPOINT_START_DELAY_TIME,
                         this::getAsyncCheckpointStartDelayNanos);
+        recordWriter.setMaxOverdraftBuffersPerGate(0);

Review Comment:
   Thanks for your review, added.



-- 
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] 1996fanrui commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r907979743


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -385,11 +385,16 @@ public Task(
                 shuffleEnvironment.createShuffleIOOwnerContext(
                         taskNameWithSubtaskAndId, executionId, metrics.getIOMetricGroup());
 
+        boolean overdraftBufferEnabled =
+                !nameOfInvokableClass.equals(
+                        "org.apache.flink.streaming.runtime.tasks.SourceStreamTask");

Review Comment:
   Hi @pnowojski , thanks for your suggestion.
   
   It can be considered, I tried, it has some advantages that no need to modify the Task, only the SourceStreamTask, but it will break more interfaces.
   
   We need call `ResultPartition#setMaxOverdraftBuffers in SourceStreamTask`  and ResultPartition will call `LocalBufferPool#setMaxOverdraftBuffers`.
   
   Call chain:
   - `recordWriter.getRecordWriter(n).getTargetPartition().setMaxOverdraftBuffers(x)`
   -  `LocalBufferPool#setMaxOverdraftBuffers`
   
   The getTargetPartition need to be changed, and need to add 2 setMaxOverdraftBuffers.
   
   I think both are fine, what do you think?



-- 
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] 1996fanrui commented on pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on PR #20075:
URL: https://github.com/apache/flink/pull/20075#issuecomment-1170065411

   Hi @pnowojski , thanks for your suggestion and review.


-- 
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] pnowojski commented on pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

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

   Test failure is unrelated and already being fixed: https://issues.apache.org/jira/browse/FLINK-28269


-- 
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] pnowojski commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
pnowojski commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r908137668


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -385,11 +385,16 @@ public Task(
                 shuffleEnvironment.createShuffleIOOwnerContext(
                         taskNameWithSubtaskAndId, executionId, metrics.getIOMetricGroup());
 
+        boolean overdraftBufferEnabled =
+                !nameOfInvokableClass.equals(
+                        "org.apache.flink.streaming.runtime.tasks.SourceStreamTask");

Review Comment:
   I suggested it, because it encapsulates this logic inside `SourceStreamTask`, making it easier to find and maintain. At the same time it avoids this quite hacky and nasty `nameOfInvokableClass.equals("org.apache.flink.streaming.runtime.tasks.SourceStreamTask");`. So if the code is comparably complicated I would be +1 for changing 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] 1996fanrui commented on pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on PR #20075:
URL: https://github.com/apache/flink/pull/20075#issuecomment-1167003999

   Hi @pnowojski @akalash , I have submitted the task3 of the overdraft buffer, that is, disable overdraft buffer for LegacySource. Please help review in your free time, 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] 1996fanrui commented on a diff in pull request #20075: [FLINK-27789][network] Disable overdraft buffer for LegacySource

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on code in PR #20075:
URL: https://github.com/apache/flink/pull/20075#discussion_r909185339


##########
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java:
##########
@@ -385,11 +385,16 @@ public Task(
                 shuffleEnvironment.createShuffleIOOwnerContext(
                         taskNameWithSubtaskAndId, executionId, metrics.getIOMetricGroup());
 
+        boolean overdraftBufferEnabled =
+                !nameOfInvokableClass.equals(
+                        "org.apache.flink.streaming.runtime.tasks.SourceStreamTask");

Review Comment:
   Updated.



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