Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.17.1
Description
The SourceCoordinator.WatermarkAggregator#aggregate method will find the smallest watermark of all keys as the aggregatedWatermark.
However, the time complexity of the aggregate method in a WatermarkAlignment updateInterval cycle is O(n*n),because:
- Every subtask report a latest watermark to SourceCoordinator in a WatermarkAlignment updateInterval cycle
- SourceCoordinator updates the smallest watermark from all subtasks for each reporting
In general, the key is subtaskIndex, so the number of key is parallelism. When the parallelism is high, the watermark aggregation performance will be poor.
Performance Test:
The parallelism is 10000, each subtask reports 20 watermarks, and the aggregate method takes 18.921s. Almost every round takes 950 ms.
- If the watermarkAlignment updateInterval is 1s, SourceCoordinator will be very busy.
- If it's less than 1s, the Watermark aggregation will be delayed
I have finished the POC for performance improvement, and reduced Watermark aggregation time per watermarkAlignment updateInterval cycle from 950 ms to 6 ms.
Attachments
Attachments
Issue Links
- links to