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/04/20 03:05:04 UTC

[GitHub] [flink] zoltar9264 commented on a diff in pull request #19441: [FLINK-27187][state/changelog] Add changelog storage metric totalAttemptsPerUpload

zoltar9264 commented on code in PR #19441:
URL: https://github.com/apache/flink/pull/19441#discussion_r853687720


##########
flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java:
##########
@@ -295,6 +349,39 @@ public void close() {
         }
     }
 
+    private static class FixedLatencyUploader implements StateChangeUploader {
+        private final long latency;
+
+        public FixedLatencyUploader(long latency) {
+            this.latency = latency;
+        }
+
+        @Override
+        public UploadTasksResult upload(Collection<UploadTask> tasks) throws IOException {
+            Map<UploadTask, Map<StateChangeSet, Long>> map = new HashMap<>();
+
+            try {
+                TimeUnit.MILLISECONDS.sleep(latency);

Review Comment:
   I want to simulate timeout situation instead of IOException. The difference between the two is that when MaxAttemptUploader is used, attemptNumber must be equal to totalAttempt, while when FixedLatencyUploader is used, attemptNumber is less than totalAttempt. First attempt will success with FixedLatencyUploader.
   
   In fact, I considered merging testAttemptsPerUpload and testTotalAttemptsPerUpload together. This can be  implemented by adding the following to testTotalAttemptsPerUpload:
   
   `
           HistogramStatistics attemptsPerUploadHistogram =
                   metrics.getAttemptsPerUpload().getStatistics();
           assertThat(attemptsPerUploadHistogram.getMin()).isEqualTo(1);
           assertThat(attemptsPerUploadHistogram.getMax()).isEqualTo(1);
   `
   
   How do you think about @rkhachatryan ?



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