flink-extended / flink-remote-shuffle

Remote Shuffle Service for Flink
Apache License 2.0
191 stars 56 forks source link

Enable reading buffer floating for better fairness #50

Closed wsry closed 2 years ago

wsry commented 2 years ago

Motivation

Currently, the reading buffers are allocated for a data partition when the first reader connects and are recycled when all readers finish. This strategy may cause starvation if some of the consumer tasks process very slowly and occupy reading buffers for too long, in which scenario, other data partitions may can not allocate enough buffers. We can solve this problem by recycling reading buffers before all readers finish and then allocate those buffers back. If there are other data partitions waiting for reading buffers, they can be fulfilled by the recycled buffers.

Changes

Enable reading buffer floating by recycling earlier before all readers finish.

Test