This is the first step towards vttablet not depending on mycnf. This PR makes the following changes:
* Introduce new db connectivity flags. * Mark old flags as deprecated. * If new flags are set, they supersede legacy flags. * Provide defaults to existing flags so one doesn't have to specify them for normal cases. Signed-off-by: Sugu Sougoumarane <firstname.lastname@example.org>
DBConfigs API has been changed: * Conn param members have been made private and are not changeable. * New functions like AppWithDB, etc. have been added. They return newly allocated conn params. * New DBName field can now be set by the app, which can then be combined with conn params as needed. * SideCarDBName and DBName are atomic. There's no worry about possible race while accessing them. * 'WithDB' functions return a conn with the db name set. For cases where a db is always needed, like App, the API only provides a WithDB function. Also, vice-versa. * A test has been added to tabletmanager to show that the new flags work. Signed-off-by: Sugu Sougoumarane <email@example.com>
It's possible one may want to enable SSL for just the repl user because replication can happen on open networks. The per-user use_ssl flag allows you to select which connections use ssl and which don't. DBConfigs has been refactored to use a map instead of hardcoded user configs. This reduces boilerplating. Signed-off-by: Sugu Sougoumarane <firstname.lastname@example.org>
jvaidya left a comment
Looks great on the whole. This will really reduce a lot of confusion, especially once the deprecated parameters are deleted. Thanks for tackling this.