You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "1032851561 (via GitHub)" <gi...@apache.org> on 2023/04/07 10:28:52 UTC

[GitHub] [hudi] 1032851561 opened a new pull request, #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

1032851561 opened a new pull request, #8404:
URL: https://github.com/apache/hudi/pull/8404

   description: https://github.com/apache/hudi/issues/8087


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] danny0405 commented on a diff in pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #8404:
URL: https://github.com/apache/hudi/pull/8404#discussion_r1161556062


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/SplitProcessThread.java:
##########
@@ -0,0 +1,127 @@
+/*
+ * 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.hudi.source;
+
+import org.apache.flink.streaming.api.functions.source.SourceFunction;
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.util.function.ThrowingRunnable;
+import org.apache.hudi.adapter.MailboxExecutorAdapter;
+import org.apache.hudi.adapter.RateLimiterAdapter;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.configuration.FlinkOptions;
+import org.apache.hudi.table.format.mor.MergeOnReadInputFormat;
+import org.apache.hudi.table.format.mor.MergeOnReadInputSplit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Queue;
+
+/**
+ *  A separate thread to process splits. Can control read rate by FlinkOptions.READ_RATE_LIMIT
+ */
+public class SplitProcessThread extends Thread {
+
+  private static final Logger LOG = LoggerFactory.getLogger(SplitProcessThread.class);
+  private volatile boolean running = true;
+  private transient Queue<MergeOnReadInputSplit> splits;
+
+  private final MailboxExecutorAdapter executor;
+
+  private MergeOnReadInputFormat format;
+
+  private transient SourceFunction.SourceContext<RowData> sourceContext;
+
+  private transient ThrowingRunnable<? extends Exception> exceptionHandler;
+  private transient Option<RateLimiterAdapter> rateLimiter;
+
+  public SplitProcessThread(Queue<MergeOnReadInputSplit> splits, MailboxExecutorAdapter executor, MergeOnReadInputFormat format,
+                            SourceFunction.SourceContext<RowData> sourceContext, ThrowingRunnable<? extends Exception> exceptionHandler,
+                            int indexOfThisSubtask, int numberOfParallelSubtasks) {
+    setName(String.format("split-process-thread (%s/%s)", indexOfThisSubtask + 1, numberOfParallelSubtasks));
+    this.splits = splits;
+    this.executor = executor;
+    this.format = format;
+    this.sourceContext = sourceContext;
+    this.exceptionHandler = exceptionHandler;
+    long rate = format.getConf().getLong(FlinkOptions.READ_RATE_LIMIT);
+    this.rateLimiter = rate > 0 ? Option.of(RateLimiterAdapter.create(rate)) : Option.empty();
+  }
+
+  @Override
+  public void run() {
+    while (running) {

Review Comment:
   We lost the exactly-once semantics if the consumption is taking place in another thread, that is, when the checkpoint barrier passed by, the consumption offset is not managed synchonously within the state-backend, we consume like 2048 records per-batch, and the discrepancy can be within range [0, 2048].



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8404:
URL: https://github.com/apache/hudi/pull/8404#issuecomment-1500193330

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=16190",
       "triggerID" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2576819a6496fc9ca9dc47205453c43bd76c1a44 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=16190) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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: commits-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-6049] split_reader don't checkpoint before consuming all splits [hudi]

Posted by "1032851561 (via GitHub)" <gi...@apache.org>.
1032851561 closed pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits
URL: https://github.com/apache/hudi/pull/8404


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] SteNicholas commented on a diff in pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #8404:
URL: https://github.com/apache/hudi/pull/8404#discussion_r1161531119


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/configuration/FlinkOptions.java:
##########
@@ -339,6 +339,12 @@ private FlinkOptions() {
       .withDescription("Enables data-skipping allowing queries to leverage indexes to reduce the search space by"
           + "skipping over files");
 
+  public static final ConfigOption<Long> READ_RATE_LIMIT = ConfigOptions
+      .key("read.rate.limit")

Review Comment:
   Could it support dynamic adjustment?



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8404:
URL: https://github.com/apache/hudi/pull/8404#issuecomment-1500187376

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2576819a6496fc9ca9dc47205453c43bd76c1a44 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8404: [HUDI-6049] split_reader don't checkpoint before consuming all splits

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8404:
URL: https://github.com/apache/hudi/pull/8404#issuecomment-1500366776

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=16190",
       "triggerID" : "2576819a6496fc9ca9dc47205453c43bd76c1a44",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2576819a6496fc9ca9dc47205453c43bd76c1a44 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=16190) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot 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: commits-unsubscribe@hudi.apache.org

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