Added database list refreshing to schemarouter.

This commit is contained in:
Markus Makela
2015-06-09 16:13:06 +03:00
parent 528e69b726
commit b1c383b19e
2 changed files with 59 additions and 7 deletions

View File

@ -241,6 +241,9 @@ typedef struct schemarouter_config_st {
target_t rw_use_sql_variables_in;
int max_sescmd_hist;
bool disable_sescmd_hist;
time_t last_refresh; /*< Last time the database list was refreshed */
double refresh_min_interval; /*< Minimum required interval between refreshes of databases */
bool refresh_databases; /*< Are databases refreshed when they are not found in the hashtable */
} schemarouter_config_t;
/**
@ -313,6 +316,7 @@ typedef struct router_instance {
struct router_instance* next; /*< Next router on the list */
bool available_slaves; /*< The router has some slaves available */
} ROUTER_INSTANCE;
#define BACKEND_TYPE(b) (SERVER_IS_MASTER((b)->backend_server) ? BE_MASTER : \