Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki: Add a ring to the compactor used to control concurrency when not running standalone #4574

Merged
merged 14 commits into from
Nov 1, 2021

Conversation

slim-bean
Copy link
Collaborator

What this PR does / why we need it:

To simplify operations, we want to enable a horizontally scalable "all" target as well as the new "read" "write" targets, without having to run a separate compactor.

This PR adds a ring to the compactor which is used for leader election by looking to see which instance has a specific key in the ring.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

All: {QueryScheduler, QueryFrontend, Querier, Ingester, Distributor, Ruler},
Read: {QueryScheduler, QueryFrontend, Querier, Ruler},
All: {QueryScheduler, QueryFrontend, Querier, Ingester, Distributor, Ruler, Compactor},
Read: {QueryScheduler, QueryFrontend, Querier, Ruler, Compactor},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasons for putting the compactor on the read path:

  • having consistent performance on all write nodes is more critical than read nodes
  • the compactor is a read path optimization and is not critical to writes

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of comments, but I think I'm fine with the compactor always depending on the ring, even when run with -target=scheduler. I believe it's worse to maintain two code paths and I suspect we'll eventually need it anyway for horizontally scalable compaction.

pkg/loki/config_wrapper.go Show resolved Hide resolved
pkg/loki/modules.go Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor.go Outdated Show resolved Hide resolved
pkg/loki/config_wrapper.go Outdated Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor_ring.go Outdated Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor_ring.go Outdated Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor_ring.go Outdated Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor_ring.go Outdated Show resolved Hide resolved
pkg/storage/stores/shipper/compactor/compactor_ring.go Outdated Show resolved Hide resolved
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@slim-bean slim-bean merged commit 0c9bead into main Nov 1, 2021
@slim-bean slim-bean deleted the compactor-ring branch November 1, 2021 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants