-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add a Ring to IndexGateway #5358
Merged
sandeepsukhani
merged 44 commits into
grafana:main
from
JordanRushing:add-ring-to-index-gateway
Apr 13, 2022
Merged
Changes from 33 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
0ba13f0
Begin to add a Ring to IndexGateway
JordanRushing d928391
Implement missing methods for IndexGateway.
DylanGuedes 325ada2
Fix failing linter
JordanRushing 100e32c
Implement IndexGateway support for dynamic configs.
DylanGuedes c7797f4
Implement NewBasicService for the IndexGateway.
DylanGuedes b6d6629
Test IndexGateway dynamic configuration.
DylanGuedes 99df166
Implement new IndexGatewayGRPCPool entity.
DylanGuedes 6eb1595
Make IndexGateway attributes public.
DylanGuedes 0417045
Implement IndexGatewayRing reader.
DylanGuedes 55db3eb
Implement Ring mode in the IndexGatewayClient.
DylanGuedes d884301
Add new ring index gateway parameter to new Store calls.
DylanGuedes 6cc5034
Use errors.Wrap instead of fmt.Errorf.
DylanGuedes 82393f1
Extract tenantID from context instead of iterating on queries.
DylanGuedes a4f717c
Remove indexGateway ring param.
DylanGuedes 88224a8
Split IndexGateway server from client implementation.
DylanGuedes 6d68a6c
Fix imports order.
DylanGuedes 947611c
Remove ring as parameter from IndexGateway-related funcs.
DylanGuedes 1004469
Fix default flag value and IndexQuerier type.
DylanGuedes f0a6b31
Remove additional mode field and reuse it from cfg.
DylanGuedes cccb298
Remove redundant service init.
DylanGuedes e824c21
Add sanity check for IndexGateway client constructor.
DylanGuedes 99d39f2
Move mode assigning to initStore method.
DylanGuedes bd910d9
Reorder IndexGateway constructor.
DylanGuedes 7510b47
Rewrite indexClient chunk.IndexClient as querier Index.Querier.
DylanGuedes 47c4fc2
Fix flag registration for IndexGateway server.
DylanGuedes 3dc51d6
Fix flag registration for test.
DylanGuedes 6323a94
Keep only one reference to indexQuerier.
DylanGuedes 88829bf
Add guard-clause on IndexGatewayRing service.
DylanGuedes 18559e9
Move IndexGatewayClientCfg to gateway_client file.
DylanGuedes d59f7ee
Merge pull request #13 from JordanRushing/ring-mode-index-gateway
JordanRushing 4629273
Update CHANGELOG.md for `IndexGateway` support for `RingMode`
JordanRushing 5c81c8e
Merge branch 'grafana:main' into add-ring-to-index-gateway
JordanRushing ebf12c0
Update GatewayClient to use dskit tenant package
JordanRushing ccbf492
Add listenport configuration for IndexGateway and Ring
JordanRushing 0379649
Make IndexGateway replication factor configurable.
DylanGuedes a5dda13
Randomize replication set access.
DylanGuedes bda00af
Merge branch 'main' of github.com:grafana/loki into add-ring-to-index…
DylanGuedes 03c5a7c
Merge branch 'main' of github.com:grafana/loki into add-ring-to-index…
DylanGuedes 62dd62a
Remove unwanted merge HEAD tags.
DylanGuedes 2d602ae
Move away from stores/chunk package.
DylanGuedes 54d6a27
Pass util_log in factory.
DylanGuedes 571b90e
Change index gateway client ring to ignore replicas.
DylanGuedes 6fbd178
Refactor where the common replication factor is applied.
DylanGuedes b118248
Housekeeping config_wrapper IndexGateway configs.
DylanGuedes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the reason this needs to be a top level module (vs. having the logic to enable/disable the ring be inside the
initIndexGateway
code) because it's a shared dependency between both theStore
and theIndexGateway
? Can those module be enabled/disabled independent of one another?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context: there's an index gateway server and index gateway clients. The clients needs a read ring (provided by the IndexGatewayRing service), while the server needs the whole index gateway service. So, the server needs way more stuff than the other services (ex: the store) as they only need a ring, and sharing the whole server with the store was too much.
Now, to your question: yes, this had to be a top-level module, but not because the ring is shared between the gateway server and client, because although both use the ring, they use it differently (ex: the client only requires a read ring, the server requires a lifecycler+a normal ring). This had to be a top-level module to isolate a very lean read ring, used by the clients.
To your last question: Yes, they can be disabled/independent because you can run an index gateway ring without any clients connecting to it, and you can also have an index gateway client without any server registered in the ring and it will still run - but won't communicate with any index gateway.