Skip to content

[Flink] Support withShard read of Flink #5650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wwj6591812
Copy link
Contributor

@wwj6591812 wwj6591812 commented May 22, 2025

Purpose

In my company, we use Flink session cluster read paimon for OLAP.

When the QPS of search is high, many problems are gradually becoming apparent.
1、The JobManager's IO is high. Because all job's plan will read meta on FileSystem.
2、To accelerate queries, when we scale-up scan.manifest.parallelism, the memory of JobManager is high.
3、The query speed become slow. Because when QPS is high, the JobManager is busy, this will reduce the speed of the plan or other logic.
4、When QPS is high, the memory is heavy, even though we DropStats after plan.

We found the reason is all job's plan is run on JobManager. In order for the system can accept higher QPS and the query speed can be faster, we we want add an option that user can move the plan to TaskManager.

Be more detailed, when open the option, ShardStaticFileStoreSource will create as many splits as source parallelism, this splits will be assigned to reader. In ShardSourceReader#addSplits we use TableScan withShard feature to get the splits that belong to this reader.
image

When DynamicPartitionPruning enabled, we add the DynamicPartitionPruning info into MockSplit, after reader receive it, reader will filter partitions after plan withShard.
image

Tests

1、UT cases
org.apache.paimon.flink.source.shardread.ShardReadAssignModeTest
org.apache.paimon.flink.source.shardread.ShardSourceReaderTest

2、IT cases
org.apache.paimon.flink.source.shardread.ShardReadITCase

3、Job Test
We run some jobs to test data integrity. The result is no problem.
(1) Without ShardRead
image

(2)ShardRead Without Failover Without Speculation Execution.
image

(3) ShardRead Without Failover with Speculation Execution.
image

(4)ShardRead With Failover Without Speculation Execution.
image

(5) ShardRead With Failover With Speculation Execution.
image

API and Format

Documentation

@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch 2 times, most recently from 1700b4e to 131ca92 Compare May 22, 2025 12:34
@wwj6591812 wwj6591812 changed the title [WIP][Flink] Support withShard read of Flink [Flink] Support withShard read of Flink May 22, 2025
@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch 4 times, most recently from 262683a to cc658ff Compare May 23, 2025 09:10
@wwj6591812 wwj6591812 changed the title [Flink] Support withShard read of Flink [WIP][Flink] Support withShard read of Flink May 23, 2025
@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch 2 times, most recently from 64790a0 to 2abbd10 Compare May 24, 2025 15:24
@wwj6591812 wwj6591812 changed the title [WIP][Flink] Support withShard read of Flink [Flink] Support withShard read of Flink May 24, 2025
@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch from 2abbd10 to 42e3cce Compare May 25, 2025 15:46
@wwj6591812
Copy link
Contributor Author

@JingsongLi Hi, please CC, Thx.

@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch from 42e3cce to 3696243 Compare May 29, 2025 10:16
@wwj6591812 wwj6591812 force-pushed the support_with_shard_read_of_flink_0522 branch from 3696243 to aa5c8d3 Compare May 29, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant