Skip to content

Commit bc71ca3

Browse files
committed
[HUDI-3942] [RFC-50] Improve Timeline Server
1 parent f8b9399 commit bc71ca3

5 files changed

Lines changed: 93 additions & 0 deletions

File tree

rfc/rfc-50/ComparisonDiagram.png

196 KB
Loading

rfc/rfc-50/CurrentDesign.png

117 KB
Loading

rfc/rfc-50/Design.png

112 KB
Loading

rfc/rfc-50/SchematicDiagram.png

130 KB
Loading

rfc/rfc-50/rfc-50.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
# RFC-50: Improve Timeline Server
19+
20+
## Proposers
21+
- @yuzhaojing
22+
23+
## Approvers
24+
- @xushiyan
25+
- @danny0405
26+
27+
## Abstract
28+
29+
Support client to obtain timeline from timeline server.
30+
31+
## Background
32+
33+
At its core, Hudi maintains a timeline of all actions performed on the table at different instants of time. Before each operation is performed on the Hoodie table, the information of the HUDI table needs to be obtained through the timeline. At present, there are two ways to obtain the timeline of HUDI :
34+
- Create a MetaClient and get the complete timeline through MetaClient #getActiveTimeline, which will directly scan the HDFS directory of metadata
35+
- Get the timeline through FileSystemView#getTimeline. This timeline is the cache timeline obtained by requesting the Embedded timeline service. There is no need to repeatedly scan the HDFS directory of metadata, but this timeline only contains completed instants
36+
37+
### Problem description
38+
39+
- HUDI designs the Timeline service for processing and caching when accessing metadata , but currently does not converge all access to metadata to the Timeline service, such as the acquisition of a complete timeline.
40+
- When the number of tasks written increases, a large number of repeated access to metadata will lead to high HDFS NameNode requests, causing greater pressure and not easy to expand.
41+
42+
### Spark and Flink write flow comparison diagram
43+
44+
Since Hudi is designed based on the Spark micro-batch model, in the Spark write process, all operations on the timeline are completed on the driver side, and then distributed to the executor side to start the write operation.
45+
46+
But for Flink , Write tasks are resident services due to their pure streaming model. There is also no highly reliable communication mechanism between the user-side JM and the TM in Flink, so the TM needs to obtain the latest instant by polling the timeline for writing.
47+
48+
![](ComparisonDiagram.png)
49+
50+
### Current
51+
52+
![](CurrentDesign.png)
53+
54+
The current design implementation has two main problems with the convergence timeline
55+
- Since the timeline of the task is pulled from the Embedded timeline service, the refresh mechanism of the Embedded timeline service itself will doesn't work
56+
- MetaClient and HoodieTable are decoupled. Obtain the timeline in MetaClient and then request the Embedded timeline service to obtain file-related information through the FileSystemViewManager in HoodieTable combined with the timeline. There are circular dependencies and problems in the case of using MetaClient alone without creating HoodieTable
57+
58+
## Implementation
59+
60+
### Design target
61+
62+
The goal of this solution is to converge the acquisition of timelines and obtain them through the Embedded timeline service uniformly. The timeline is pulled through HDFS only when the Embedded timeline service is not started.
63+
64+
### Converge the request to loop instant in Flink to JM
65+
66+
- Store the latest instant on the Embedded Timeline Server. Every time JM modifies the instant state, it actively performs a sync to Embedded Timeline Server
67+
- Return the latest instant directly when the task pulls the latest instant
68+
69+
### Converge the request to pull instant in meta client initialization to JM
70+
71+
- Abstract the timeline-related acquisition methods into the new interface TableTimelineView, and create the corresponding TimelineViewManager in MetaClient, and obtain the timeline through TimelineViewManager.
72+
73+
![](Design.png)
74+
75+
### Flink optimization before and after schematic diagram
76+
77+
![](SchematicDiagram.png)
78+
79+
## Rollout/Adoption Plan
80+
81+
- What impact (if any) will there be on existing users?
82+
- Since the Embedded Timeline Service is used to pull the timeline, users who use flink to write to hudi will observe that file system requests are greatly reduced, thereby reducing the pressure on the file system.
83+
- However, in a scenario with a relatively high degree of parallelism, it may be necessary to increase the resources of JM to ensure the effectiveness of the response
84+
- If we are changing behavior how will we phase out the older behavior?
85+
- Add a configuration to control this behavior
86+
- If we need special migration tools, describe them here.
87+
- No special migration tools will be necessary
88+
- When will we remove the existing behavior
89+
- In subsequent releases (1.0 or later)
90+
## Test Plan
91+
92+
Test plan
93+
No additional regression testing is required, as the behavior of MetaClient's active timeline has not been changed

0 commit comments

Comments
 (0)