-
Notifications
You must be signed in to change notification settings - Fork 60
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
Include ring instance ID in InstanceDesc #387
Conversation
This looks like a good start, but the change will only apply to new entries that get added to the ring. What about existing entries? I wonder if we should add some "fixup" method to the |
Sure, good idea. Is this the type of code that we'll need to keep around indefinitely or something to remove after a while? |
I don't see a problem with keeping this indefinitely. |
Actually from what I can tell looking at the ring code, it seems like pods will add themselves to the ring on start up, updating their existing entry if required. If we make sure ID is set everywhere instances add themselves, do we still need to go through and update the |
I guess explicitly fixing up the |
It would mean that any code using updated dskit can already start using |
I've tested setting instance IDs based on map keys locally with Mimir:
Everything worked as expected, distributors had access to the ingester IDs when creating clients for the ingesters. I'm going to test in a dev cluster, only using this new code in distributors. |
3f946cc
to
a9900ef
Compare
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.
Thank you! The changes look good. I've verified that both lifecyclers update its instance's ID field in the ring.
BasicLifecycler
makes sure to update ID
of its entry in the ring in the registerInstance
method, even if entry already exists.
Lifecycler
uses initRing
to add entry to the ring. But if the entry already exists and it's in the JOINING
state, entry's ID field will not be updated. However it will be updated later during heartbeating.
I'd suggest to add changelog entry mentioning changes in the client
package as well.
This change adds the ID on an instance in a ring to its InstanceDesc object. This allows callers to access the ID of a member of a ring. This change also modifies the PoolFactory type to accept an InstanceDesc object when creating a new client instead of only the address. This allows PoolFactory implementations to attach any extra metadata about the instance to metrics/logs/traces for the client. See grafana/mimir#6128 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
f4b8c39
to
03e4395
Compare
Update dskit to pull in changes that give us access to instance IDs when connecting to them via the ring client pool. Specifically the changes from grafana/dskit#387 Fixes #6128 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Update dskit to pull in changes that give us access to instance IDs when connecting to them via the ring client pool. Specifically the changes from grafana/dskit#387 Fixes #6128 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
This change adds the ID on an instance in a ring to its InstanceDesc object. This allows callers to access the ID of a member of a ring. This change also modifies the PoolFactory type to accept an InstanceDesc object when creating a new client instead of only the address. This allows PoolFactory implementations to attach any extra metadata about the instance to metrics/logs/traces for the client. See grafana/mimir#6128 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
What this PR does:
This change adds the ID on an instance in a ring to its InstanceDesc object. This allows callers to access the ID of a member of a ring.
This change also modifies the PoolFactory type to accept an InstanceDesc object when creating a new client instead of only the address. This allows PoolFactory implementations to attach any extra metadata about the instance to metrics/logs/traces for the client.
Which issue(s) this PR fixes:
See grafana/mimir#6128
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]