-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ccl/sqlproxyccl: CC code migration to DB
Previsouly the sql proxy code was in the CC repo. This was making the testing of the proxy against a live SQL server hard and was also requiring a frequent cockroach repo bumps in case of changes. This moves all the code from the CC report to the DB repo so now the proxy is part of the cockroach executable. More detailed list of changed: * The old, sample star-proxy code has been retired in favor of the code moving over from the CC repo. * The code that handles individual connections to the backend has been separated into a new ProxyHandler. Added tests for the proxy handler. * BackendConfig has been retired. * Using stop.Stopper to control the shutdown of the proxy. * Added a command under mt that can be used to run the test directory server. * Added proxy options to control idle timeout, rate limits, config options, use of directory server etc. * Added code to monitor and handle os signals (HUP, TERM, INT). * Intergated the cert manager so the certificates can be reloaded on external signal. * Fixed the SQL tenant process so now the idle timeout causes the stopper to quiesce and the process to terminate successfuly. * Set up the logging for the new proxy. * Added a self-signed cert type to the cert manager to be used when testing secure connections witout generating explicit key/cert files. * Moved the HookGlobal code from CC that can be used for temporary hooks during testing. Here is how to test end to end the proxy, SQL tenant and host server, using the test directory: ``` # Start a host server in insecure mode. Tenants should already have been configured. ./cockroach start-single-node --insecure --log="{sinks: {stderr: {filter: info}}}" # Start a test directory server ./cockroach mt test-directory --port 36257 --log="{sinks: {stderr: {filter: info}}}" # Start a proxy server that uses the directory server ./cockroach mt start-proxy --directory=:36257 --listen-metrics=:8081 --log="{sinks: {stderr: {filter: info}}}" --insecure # Start a SQL client for one of the tenants. ./cockroach sql --url="postgresql://[email protected]:46257/dim-dog-2.defaultdb" --insecure ``` Release note: None
- Loading branch information
Showing
54 changed files
with
2,309 additions
and
1,372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.