yuzhaojing commented on a change in pull request #4309:
URL: https://github.com/apache/hudi/pull/4309#discussion_r828086193



##########
File path: rfc/rfc-43/rfc-43.md
##########
@@ -0,0 +1,222 @@
+<!--
+  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-43: Implement Compaction/Clustering Service for Hudi
+
+## Proposers
+- @yuzhaojing
+
+## Approvers
+- @garyli1019
+- @leesf
+- @vinothchandar
+
+## Status
+JIRA: 
[https://issues.apache.org/jira/browse/HUDI-3016](https://issues.apache.org/jira/browse/HUDI-3016)
+
+## Abstract
+
+Hudi table needs compaction/clustering to rewrite data. Currently, schedule 
compaction/clustering job provides Three ways:
+
+- Inline, execute compaction/clustering job and writing job in the same 
application, perform the compaction/clustering job and writing job serially.
+
+- Async, execute compaction/clustering job and writing job in the same 
application, Async parallel execution of compaction/clustering job and write 
job.
+
+- Independent compaction/clustering job, execute an async 
compaction/clustering job of another application.
+
+With the increase in the number of HUDI tables, due to a lack of management 
capabilities, maintenance costs will become higher. This proposal is to 
implement an independent compaction/clustering Service to manage the Hudi 
compaction/clustering job.
+
+## Background
+
+In the current implementation, if the HUDI table needs do compact/cluster, it 
only has three ways:
+
+1. Use inline compaction/clustering, in this mode the job will be block 
writing job.
+
+2. Using Async compaction/clustering, in this mode the job execute async but 
also sharing the resource with HUDI to write a job that may affect the 
stability of job writing, which is not what the user wants to see.
+
+3. Using independent compaction/clustering job is a better way to schedule the 
job, in this mode the job execute async and do not sharing resources with 
writing job, but also has some questions:
+   1. The user needs to manually start an async compaction/clustering 
application, which means that the user needs to maintain two jobs.
+   2. With the increase in the number of HUDI jobs, there is no unified 
service to manage compaction/clustering jobs (monitor, retry, history, etc...), 
which will make maintenance costs increase.
+
+With this effort, we want to provide an independent compaction/clustering 
Service, it will have these abilities:
+
+- Provides a pluggable execution interface that can adapt to multiple 
execution engines, such as Spark and Flink.
+
+- With the ability to failover, need to be persisted compaction/clustering 
message.
+
+- Perfect metrics and reuse HoodieMetric expose to the outside.
+
+- Provide automatic failure retry for compaction/clustering job.
+
+## Implementation
+
+![](service.png)
+
+### Client
+
+Register to Service with CompactionConfig/ClusteringConfig when the job 
starts. When generating a compaction/clustering plan, report to the 
compaction/clustering Service address specified in HoodieConfig and request the 
Service to stop the corresponding compaction/clustering job when the Service is 
not required or rollback compaction/clustering instant.
+
+### Request Handler
+
+Receive the client's request and save the plan in the meta table.
+
+### Meta Table
+
+Meta table has been implemented by using an internal HUDI MOR Table to store 
the required metadata for the compaction/clustering message. This table will be 
internal to a dataset and will not be exposed directly to the user to 
write/modify.
+
+The Meta Table has the following features:
+
+1. Is a HUDI MOR Table
+
+2. Defines its own custom payload HoodieServicePayload
+
+3. Use basePath + instant as recordKey to guarantee unique
+
+4. Follows all the conventions of a HUDI Table
+
+### Scheduler

Review comment:
       In my concept, the scheduler is not a separate service, it is just a 
thread in the service.




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