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/05/15 13:11:36 UTC

[GitHub] [flink] rkhachatryan opened a new pull request #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

rkhachatryan opened a new pull request #12173:
URL: https://github.com/apache/flink/pull/12173


   ## What is the purpose of the change
   
   With Unaligned checkpoints enabled, when there are no channel state handles, the underlying FS stream is still created. On discard it is not deleted because it's not referenced by any state handles.
   This prevents checkpoint from being subsumed.
   
   This was causing e2e test `test_stateful_stream_job_upgrade.sh` to fail (which is re-enabled in this PR).
   
   ## Brief change log
   
    - add a check for emptyness of handles before creating an underlying stream
    - add unit test
    - revert reverse of [FLINK-17467][task][e2e] Modify existing upgrade test to verify aligned savepoints
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
    - Added unit test: `ChannelStateCheckpointWriterTest.testEmptyState`
    - Re-enabled e2e test: `test_stateful_stream_job_upgrade.sh`
   
   
   ## 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/Mesos, ZooKeeper: yes
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable 
   


----------------------------------------------------------------
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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   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 a05709a1296e952aa3ed65c92957fc039bd90fc0 (Fri May 15 13:16:40 UTC 2020)
   
   **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] pnowojski commented on pull request #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   e2e tests failed because of https://issues.apache.org/jira/browse/FLINK-17724 but the job upgrade test passed (this PR was fixing it & re-enabling 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] pnowojski commented on a change in pull request #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateCheckpointWriter.java
##########
@@ -150,6 +151,12 @@ private void complete(boolean precondition, RunnableWithException complete) thro
 	}
 
 	private void finishWriteAndResult() throws IOException {
+		if (inputChannelOffsets.isEmpty() && resultSubpartitionOffsets.isEmpty()) {
+			dataStream.close();
+			result.inputChannelStateHandles.complete(emptyList());
+			result.resultSubpartitionStateHandles.complete(emptyList());
+			return;
+		}

Review comment:
       Don't we have to clean up/remove some empty file? I guess in this branch, `dataStream` will be empty and we have already created some file for it? In other words, won't this code leave a lingering empty files somewhere?




----------------------------------------------------------------
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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   


----------------------------------------------------------------
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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1442",
       "triggerID" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a05709a1296e952aa3ed65c92957fc039bd90fc0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1442) 
   
   <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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a05709a1296e952aa3ed65c92957fc039bd90fc0 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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   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 a05709a1296e952aa3ed65c92957fc039bd90fc0 (Fri Oct 16 10:31:38 UTC 2020)
   
   **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] rkhachatryan commented on a change in pull request #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateCheckpointWriter.java
##########
@@ -150,6 +151,12 @@ private void complete(boolean precondition, RunnableWithException complete) thro
 	}
 
 	private void finishWriteAndResult() throws IOException {
+		if (inputChannelOffsets.isEmpty() && resultSubpartitionOffsets.isEmpty()) {
+			dataStream.close();
+			result.inputChannelStateHandles.complete(emptyList());
+			result.resultSubpartitionStateHandles.complete(emptyList());
+			return;
+		}

Review comment:
       No, this is the contract of `CheckpointStateOutputStream`: `closeAndGetHandle` persists the data, while `close` removes the file.




----------------------------------------------------------------
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 #12173: [FLINK-17727][task] don't create output stream with no channel state (unaligned checkpoints)

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1442",
       "triggerID" : "a05709a1296e952aa3ed65c92957fc039bd90fc0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a05709a1296e952aa3ed65c92957fc039bd90fc0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1442) 
   
   <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