Slackbot
03/08/2024, 3:18 AMKai Sun
03/08/2024, 10:25 PMt0:
H0: group by 8 segments with 16 hydrants in total
L0: group by 2 segments with 2 hydrants in total
t1:
H1: group by 8 segments with 16 hydrants in total
L0: group by 2 segments with 2 hydrants in total.
t2:
....
So before this change, H0 (high priority query) and L0 at t0 would both make progress in the thread processing pool for the reason that H0 will only use 8 threads to process its 8 segments. ( The hydrants within the same segment are processed in the same thread sequentially.) Thus, the would be 2 threads left for L0 (low priority query) to make progress.
It is not hard to see that if high priority query is processed at the roughly the same time span as low priority query, both queries would make progress with the threads usages as 8:2 ratio.
Now, with this change, H0 would take over the 10 threads as it 16 hydrants (more than 10 threads slot in the processing pool) and leave no threads for L0 to progress. So L0 and subsequent low priority queries would "starve" and never make progress.
In general we can say before this changes, as long as the segment count of total on-going high priority queries is less than the processing thread pool size, the low priority queries can make progress.
After the change, only as long as the hydrant count of total on-going high priority queries is less than the processing thread pool size, the low priority queries can make progress
In practice, it is very likely to see "starvation" of low priority queries (or much longer running time for low priority queries) previous not seen before.