curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CURATOR-275) Allow service instances to be disabled temporarily
Date Fri, 06 Nov 2015 21:58:11 GMT


ASF GitHub Bot commented on CURATOR-275:

Github user joelittlejohn commented on the pull request:
    It's a very good point @serranom. 
    There's nothing stopping someone from doing this via the API (I don't think) since you
can simply create a new ServiceInstance (based on the field values of the instance you want
to disable) but pass `false` as the enabled value, then use [ServiceDiscovery#updateService(ServiceInstance)](
to apply the change. This is the kind of thing a dashboard/tool (that has no knowledge of
the znode layout) could do. So in this way, all ServiceInstance fields are always updatable
via the API.
    I saw this as an administrative task that (as the least worst option) allows an update
to the znode to disable an instance. I thought of this as a useful administrative hook but
not necessarily an operation that needs to part of the core API. If we did want _improved_
support for this in the API it would be easy to add this e.g. 
    `ServiceDiscovery#enable(ServiceInstance)` and `ServiceDiscovery#disable(ServiceInstance)`
    `ServiceInstance#enable()` and `ServiceInstance#disable()`
    (followed by `ServiceDiscovery#updateService(ServiceInstance)`)

> Allow service instances to be disabled temporarily
> --------------------------------------------------
>                 Key: CURATOR-275
>                 URL:
>             Project: Apache Curator
>          Issue Type: New Feature
>          Components: Recipes
>            Reporter: Joe Littlejohn
> Allow service instances to be temporarily removed from discovery (when using the Service
Discovery recipe). 
> This can be achieved with a new 'enabled' flag that is included as part of the service
instance node data in Zookeeper. Updating this flag via e.g. Exhibitor will allow an instance
to be disabled. When the flag is omitted, the service is assumed to be enabled, hence this
change is backward compatible.

This message was sent by Atlassian JIRA

View raw message