-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 controller API to get allLiveInstances #12498
Add controller API to get allLiveInstances #12498
Conversation
5ad2472
to
4b429ab
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12498 +/- ##
============================================
- Coverage 61.75% 61.71% -0.05%
Complexity 207 207
============================================
Files 2436 2449 +13
Lines 133233 133505 +272
Branches 20636 20686 +50
============================================
+ Hits 82274 82386 +112
- Misses 44911 45037 +126
- Partials 6048 6082 +34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4b429ab
to
df9b376
Compare
df9b376
to
2b5e778
Compare
@Path("/liveinstances") | ||
@Authorize(targetType = TargetType.CLUSTER, action = Actions.Cluster.GET_INSTANCE) | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@ApiOperation(value = "List all live instances") |
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.
Would this also list instances that have temporarily disconnected from Helix? (due to GC, regular restart, etc.)
If not, might be good to call it out explicitly in the description.
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.
I tested via the following:
- Restarted a node in one of our clusters. During the restart we did not get the instance id of that node in the
/liveinstances
ZK path. Post restart, we got the instance back.
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.
change lgtm. tagged @Jackie-Jiang to see if he has any opinions on this. I see that there was a controller task updated in #10027 to fix this issue. But having this endpoint might anyways be useful.
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.
Thanks @tibrewalpratik17 for the PR. The added API /liveinstances
seems reasonable to me.
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.
LGTM otherwise
label:
api
Adding a controller API to get all live instances in the cluster.
Updated UTs to test the change.