openshift / origin-server

OpenShift 2 (deprecated)
889 stars 516 forks source link

routing-daemon: Resynchronize with load-balancer #6405

Closed Miciah closed 8 years ago

Miciah commented 8 years ago

Resynchronize the routing daemon with the load balancer when the daemon attempts to perform on operation on an unrecognized pool or pool member.

The intention of this commit is to improve the daemon's reliability when something other than the current instance of the daemon changes the load balancer's state, for example the system administrator or clustered routing daemons.

AsyncLoadBalancerController::Pool, BatchedLoadBalancerController::Pool, LoadBalancerController::Pool, SimpleLoadBalancerController::Pool: Add synch method.

AsyncLoadBalancerController, BatchedLoadBalancerController, LoadBalancerController, SimpleLoadBalancerController: Add synch_pools method.

RoutingDaemon: Add with_pool method, which checks whether a pool exists, resynchronizes the daemon with the load balancer if it is not found (using the new synch_pools controller method), optionally creates the pool if it is still not found, and invokes the supplied block if the pool is found.

RoutingDaemon#create_application: Take pool_name as a parameter rather than generating the value itself since callers will already have generated the value themselves.

RoutingDaemon#delete_application, RoutingDaemon#add_endpoint, RoutingDaemon#remove_endpoint, RoutingDaemon#add_alias, RoutingDaemon#remove_alias, RoutingDaemon#add_ssl, RoutingDaemon#remove_ssl: Use the daemon's new with_pool method in order to check whether the pool exists, esynchronize the daemon with the load balancer if an operation is attempted on an unrecognized pool, and (in the case of add methods) create the pool if it does not exist.

RoutingDaemon#remove_endpoint: Use the controller's new synch method for pools to resynchronize the daemon with the load balancer if the operation is attempted on an unknown pool member.

tiwillia commented 8 years ago

@Miciah Looks good to me sir, besides the one small comment I made.

I looked over the RoutingDaemon with these changes in mind too and I don't see it affecting anything there. Fairly confident that there aren't any other issues, although I havn't tested it myself.

Miciah commented 8 years ago

Thanks!

tiwillia commented 8 years ago

[merge] please!

openshift-bot commented 8 years ago

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/test_pull_requests/9346/) (Image: devenv_5808)

openshift-bot commented 8 years ago

Evaluated for online merge up to d3465c76aa588f100ebbaeb1fd4ff8765edaa8f1