Use async OverlordClient to submit auto-compaction tasks#14537
Use async OverlordClient to submit auto-compaction tasks#14537kfaraz wants to merge 3 commits intoapache:masterfrom
Conversation
|
Hmm, something seems odd about firing a future and never doing anything with the return (other than logging it). What happens if another CompactSegments runs before the first one's What do you think about an alternate approach using different threads for different duty cycles? |
|
Thanks for the feedback, @gianm . I had similar thoughts which is why I held off on this PR (forgot to mark this
|
Yes, that is the other approach I had in mind. I was a little concerned about race conditions between different duty groups. But the right design would be to break up the duty groups in such a way that they are completely independent and parallelizable (which is most likely already the case). I went ahead with the current approach instead as it retained the same flow and only made task submission async. All the other overlord operations done by the The current approach seemed simpler originally but now it seems like a half measure and probably brings in more complications than necessary. We already have a PR for using the OverlordClient. So I will go ahead and update this PR to simply use different threads for different duty groups (and do some validations to make sure that there cannot be any race conditions). |
|
Closing this PR as #14581 is already merged. |
All duties on the Coordinator run on the same single-threaded executor including historical management duties (segment loading and balancing) and auto-compaction.
If auto-compaction gets stuck for some reason (such as slowness while submitting tasks), it can block up the whole coordination flow causing delayed segment handoffs and ingestion failures.
This PR attempts to remedy this situation by not blocking coordinator while submitting compaction tasks by using the async
OverlordClientinstead ofIndexingServiceClient.Changes
OverlordClientOverlordClientinCompactSegmentsfuture.get().Pending validation
CompactSegmentsduty to ensure that we do not submit duplicate tasks.Alternate approach/Further improvement
Release note
This PR has: