Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JVMCBC-560: Do not mark Node as disconnected if service is degraded
Motivation ---------- Before this change, if a Node has a service pool that is degraded (and no other service in a non-idle state), then the Node would mark itself in a DISCONNECTED state which also would cause a NodeDisconnectedEvent to be sent into the event bus. The node might end up in a situation like the following: the node only has the config service and a query service enabled. The config service is idle since it is not used, and if the query pool goes from 1 to 2 endpoints it might temporarily go into a degraded state until the endpoint is connected as well. Since the service is now degraded and the other service is idle, without any changes the node ends up in a DISCONNECTED state. Modifications ------------- The ServiceStateZipper did not take the degraded state into account, which caused it to switch into the disconnected branch and this is not correct. This change makes the zipper recognize the degraded state from the upstream components and it will put the Node into a degraded state as well - this is largely an internal state and does not emit a disconnected event. Result ------ The SDK does not emit a NodeDisconnectedEvent if the node isn't actually disconnected. Change-Id: I7341e02d7c4fbfa81122e100855718b072838d3c Reviewed-on: http://review.couchbase.org/97197 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Graham Pople <grahampople@gmail.com>
- Loading branch information