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/27 16:55:24 UTC

[GitHub] [flink] rkhachatryan opened a new pull request #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   ## What is the purpose of the change
   
   *While implementing #12258 the check `outStream != null` was placed in `write` instead of `flush`. This PR fixes it.* 
   
   ## Verifying this change
   
   This change is a trivial rework 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/Mesos, 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 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] rkhachatryan commented on pull request #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   I've added a test: once the file is created, it's not appended until the buffer is full (which wasn't true before this fix).


----------------------------------------------------------------
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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStreamFactoryTest.java
##########
@@ -57,6 +57,23 @@ public void createStateDirectories() throws IOException {
 	//  tests
 	// ------------------------------------------------------------------------
 
+	@Test
+	@SuppressWarnings("ConstantConditions")
+	public void testWriteFlushesIfAboveThreshold() throws IOException {
+		int fileSizeThreshold = 100;
+		final FsCheckpointStreamFactory factory = createFactory(FileSystem.getLocalFileSystem(), fileSizeThreshold, fileSizeThreshold);
+		final FsCheckpointStreamFactory.FsCheckpointStateOutputStream stream = factory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE);
+		stream.write(new byte[fileSizeThreshold]);
+		File[] files = new File(exclusiveStateDir.toUri()).listFiles();
+		assertEquals(1, files.length);
+		File file = files[0];
+		assertEquals(fileSizeThreshold, file.length());
+		for (int i = 0; i < fileSizeThreshold; i++) {
+			stream.write(127); // should buffer without flushing
+		}

Review comment:
       add an additional
   ```
   stream.write(new byte[10]);
   ```
   call to also check the other write method for the flushing problem?




----------------------------------------------------------------
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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 773fda6a238b2eaf4203df9e232445c5e4236b74 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301) 
   
   <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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 773fda6a238b2eaf4203df9e232445c5e4236b74 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301) 
   * 6eef6ad43c519d62837d4e22246a4090a1aa1bd8 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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302",
       "triggerID" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "aa65f31c2e89e08a8671a3748e2a516ee183220c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2339",
       "triggerID" : "aa65f31c2e89e08a8671a3748e2a516ee183220c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6eef6ad43c519d62837d4e22246a4090a1aa1bd8 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302) 
   * aa65f31c2e89e08a8671a3748e2a516ee183220c Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2339) 
   
   <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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302",
       "triggerID" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 773fda6a238b2eaf4203df9e232445c5e4236b74 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301) 
   * 6eef6ad43c519d62837d4e22246a4090a1aa1bd8 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302) 
   
   <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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 773fda6a238b2eaf4203df9e232445c5e4236b74 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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302",
       "triggerID" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "aa65f31c2e89e08a8671a3748e2a516ee183220c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "aa65f31c2e89e08a8671a3748e2a516ee183220c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6eef6ad43c519d62837d4e22246a4090a1aa1bd8 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302) 
   * aa65f31c2e89e08a8671a3748e2a516ee183220c 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] rkhachatryan commented on a change in pull request #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStreamFactoryTest.java
##########
@@ -57,6 +57,23 @@ public void createStateDirectories() throws IOException {
 	//  tests
 	// ------------------------------------------------------------------------
 
+	@Test
+	@SuppressWarnings("ConstantConditions")
+	public void testWriteFlushesIfAboveThreshold() throws IOException {
+		int fileSizeThreshold = 100;
+		final FsCheckpointStreamFactory factory = createFactory(FileSystem.getLocalFileSystem(), fileSizeThreshold, fileSizeThreshold);
+		final FsCheckpointStreamFactory.FsCheckpointStateOutputStream stream = factory.createCheckpointStateOutputStream(CheckpointedStateScope.EXCLUSIVE);
+		stream.write(new byte[fileSizeThreshold]);
+		File[] files = new File(exclusiveStateDir.toUri()).listFiles();
+		assertEquals(1, files.length);
+		File file = files[0];
+		assertEquals(fileSizeThreshold, file.length());
+		for (int i = 0; i < fileSizeThreshold; i++) {
+			stream.write(127); // should buffer without flushing
+		}

Review comment:
       Done.




----------------------------------------------------------------
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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301",
       "triggerID" : "773fda6a238b2eaf4203df9e232445c5e4236b74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302",
       "triggerID" : "6eef6ad43c519d62837d4e22246a4090a1aa1bd8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 773fda6a238b2eaf4203df9e232445c5e4236b74 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2301) 
   * 6eef6ad43c519d62837d4e22246a4090a1aa1bd8 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2302) 
   
   <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 #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


   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 773fda6a238b2eaf4203df9e232445c5e4236b74 (Wed May 27 16:57:12 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] flinkbot edited a comment on pull request #12364: [FLINK-17986] Fix check in FsCheckpointStateOutputStream.write

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


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