This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass for router v2 implementation. The init version of router v…
…2 is done by Jun Xiao, polished by Anfernee with a couple of bug fixes and enhancement. router v2 decouples control and data path to some extent, it's a logic router including both nginx and uls (upstream location server) parts. uls (aka control plane) is based on legacy router: - all communications with nats are kept the same as before - client facing interface (actually connected to nginx) is simplified to handle the location query/stats update from nginx only. - the original app facing interface is totally removed. nginx (aka data plane) - package lua in nginx so most functionalities can be implemented with it. - for each request, nginx will generate a subrequest (to fit in nginx single thread event model) which carries location query/stats info to uls, the response of the subrequest will return backend addr and also an opaque tags (only known by uls), and the corresponding main request will also be awaked and routed to the backend server, when a response from backend is returned back, the counter associated with the particular opaque tags will be incremented accoring to the response code. The next incoming request will always help to carry not-synced stats to uls along with its location query. - sticky session and trace header are also implemented here, also their key related config are moved to nginx part. testing - "rake spec" will only test uls, while "rake test" will run both unit test and integration test with nginx - integration test requires nginx with lua module installed running Change-Id: I9b25b24c449b0421754e541ab5ba60a00c551da9
- Loading branch information