Skip to content

feat(compactor HS): add support for worker for processing of jobs from the compactor's job queue - #18165

Merged
sandeepsukhani merged 3 commits into
mainfrom
compactor-hs-add-worker
Jun 20, 2025
Merged

feat(compactor HS): add support for worker for processing of jobs from the compactor's job queue#18165
sandeepsukhani merged 3 commits into
mainfrom
compactor-hs-add-worker

Conversation

@sandeepsukhani

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
It adds two new components related to making the compactor horizontally scalable:

  1. Worker: It gets the job from the job queue over GRPC, executes the job, and sends the job response to the job queue. It keeps going while it can get jobs from the GRPC connection. If the stream gets disconnected, the worker tries to re-establish it to work on the jobs from the queue.
  2. Worker Manager: It creates a specified number of workers and implements a Stop method to stop all the workers at once.

I have done some minor changes to the existing Queue code, like:

  1. Retry the failed jobs in the goroutine we run for retrying the timed-out jobs.
  2. Removed unused Stop function.
  3. Close the q.stop channel before closing q.queue so that builders stop first, and they avoid writing to the queue, which otherwise would lead to panics.

Checklist

  • Tests updated
@sandeepsukhani
sandeepsukhani requested a review from a team as a code owner June 19, 2025 10:32
@sandeepsukhani
sandeepsukhani merged commit d05c4bc into main Jun 20, 2025
65 checks passed
@sandeepsukhani
sandeepsukhani deleted the compactor-hs-add-worker branch June 20, 2025 14:03
@paul1r paul1r mentioned this pull request Jun 20, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants