danny0405 commented on code in PR #10266:
URL: https://github.com/apache/hudi/pull/10266#discussion_r1429450376


##########
rfc/rfc-76/rfc-76.md:
##########
@@ -0,0 +1,143 @@
+<!--
+  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.
+-->
+# RFC-[76]: [support EventTimeBasedCompactionStrategy and metric for RO table]
+
+## Proposers
+
+- @waitingF
+
+## Approvers
+ - @danny0405
+ - @voonhous
+
+## Status
+
+JIRA: [HUDI-6979](https://issues.apache.org/jira/browse/HUDI-6979)
+
+> Please keep the status updated in `rfc/README.md`.
+
+## Abstract
+
+Currently, to gain low ingestion latency, we can adopt the MergeOnRead table, 
which support appending log files and 
+compact log files into base file later. When querying the snapshot table (RT 
table) generated by MOR, 
+query side have to perform a compaction so that they can get all data, which 
is expected time-consuming causing query latency.
+At the time, hudi provide read-optimized table (RO table) for low query 
latency just like COW.
+
+Generally the data to ingest arrives roughly in event time order. For cases 
some users read the hudi table,
+they may not concern with the immediate full data, but the data before a 
specified time T (eg. data before 0 clock).
+For such cases, user want all data before a specified time, user have to query 
the RT table to get all data with expected high query latency.
+
+Based on this, we want to implement the strategy based on the event time: 
`EventTimeBasedCompactionStrategy`. 
+
+
+## Background
+
+Currently, there is no compaction strategy based on event time, the only 
`DayBasedCompactionStrategy` need the table partitioned by day in specified 
format(yyyy/mm/dd), 
+which is not very general and has too large a time granularity. There is no 
data completion/freshness guarantee or metrics for RO table.
+
+Based on this, we plan to 
+1. launch a compaction strategy based on event time: 
`EventTimeBasedCompactionStrategy`.
+2. report RO table data completion and freshness.
+
+With the data completion and freshness of RO table, we can expand use-case of 
RO table.
+That is given event time threshold T, the log files before T can be compacted, 
then resulting RO table obtains all data before T, with low query latency.
+
+Currently, we introduced new file slicing algorithm based on barrier and 
generating compaction plan based on completion time 
[[HUDI-6495][RFC-66]](https://github.com/apache/hudi/pull/7907).
+
+With the barrier file slicing, file slices are split by the barriers extracted 
from every instant time of base files 
+or the first instant of log file if no base file exists.
+
+When generating compaction plan, the scheduler will filter all log files with 
completion time before the `compactionInstant`. 
+And the compaction operation will generate a new base file with 
`compactionInstant` as its instant time;
+
+So the file slices are split naturally by the `compactionInstant` for MOR 
cases. 
+
+So we can replace the `compactionInstant` with `eventTimeInstant` computed by 
`EventTimeBasedCompactionStrategy` when generating plan. 
+In this case, file slices are split by `eventTimeInstant` instead of 
`compactionInstant`. 
+This is the base for `EventTimeBasedCompactionStrategy`.

Review Comment:
   feasible, just to note that the generation of the `eventTImeInstant` must 
share the same lock with normal instant time generation.



-- 
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-unsubscr...@hudi.apache.org

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

Reply via email to