config.c: Added configuration parameter processing for read_ses_variables_from_slaves and for write_ses_variables_to_all . The values are read from config file, qualified and stored to service. Values are loaded when instance is created. This is limitation in current implementation and will change so that configuration is dynamically changeable.

This commit is contained in:
VilhoRaatikka
2014-09-07 23:48:16 +03:00
parent d799331c50
commit 92889ad216
5 changed files with 249 additions and 72 deletions

View File

@ -118,6 +118,8 @@ typedef enum select_criteria {
/** default values for rwsplit configuration parameters */
#define CONFIG_MAX_SLAVE_CONN 1
#define CONFIG_MAX_SLAVE_RLAG -1 /*< not used */
#define CONFIG_READ_SESVARS_FROM_SLAVES false
#define CONFIG_WRITE_SESVARS_TO_ALL false
#define GET_SELECT_CRITERIA(s) \
(strncmp(s,"LEAST_GLOBAL_CONNECTIONS", strlen("LEAST_GLOBAL_CONNECTIONS")) == 0 ? \
@ -232,6 +234,11 @@ typedef struct rwsplit_config_st {
int rw_max_slave_conn_count;
select_criteria_t rw_slave_select_criteria;
int rw_max_slave_replication_lag;
/** Route user- & system variable writes to all backends */
bool rw_write_sesvars_to_all;
/** Route queries including user- & system variables to slaves */
bool rw_read_sesvars_from_slaves;
} rwsplit_config_t;