Remove BACKEND from schemarouter and clean up code
Removed the use of the BACKEND structure and replaced it with the use of the SERVER_REF structure of the service. This allows dynamic changes to be made to the list of servers. Cleaned up parts of the code and removed obsolete or useless functions. The schemarouter module could do with some refactoring since it derives from readwritesplit.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -261,7 +261,7 @@ typedef struct backend_ref_st
|
|||||||
#endif
|
#endif
|
||||||
int n_mapping_eof;
|
int n_mapping_eof;
|
||||||
GWBUF* map_queue;
|
GWBUF* map_queue;
|
||||||
BACKEND* bref_backend; /*< Backend server */
|
SERVER_REF* bref_backend; /*< Backend server */
|
||||||
DCB* bref_dcb; /*< Backend DCB */
|
DCB* bref_dcb; /*< Backend DCB */
|
||||||
bref_state_t bref_state; /*< State of the backend */
|
bref_state_t bref_state; /*< State of the backend */
|
||||||
bool bref_mapped; /*< Whether the backend has been mapped */
|
bool bref_mapped; /*< Whether the backend has been mapped */
|
||||||
@ -357,8 +357,6 @@ typedef struct router_instance
|
|||||||
SERVICE* service; /*< Pointer to service */
|
SERVICE* service; /*< Pointer to service */
|
||||||
ROUTER_CLIENT_SES* connections; /*< List of client connections */
|
ROUTER_CLIENT_SES* connections; /*< List of client connections */
|
||||||
SPINLOCK lock; /*< Lock for the instance data */
|
SPINLOCK lock; /*< Lock for the instance data */
|
||||||
BACKEND** servers; /*< Backend servers */
|
|
||||||
BACKEND* master; /*< NULL or pointer */
|
|
||||||
schemarouter_config_t schemarouter_config; /*< expanded config info from SERVICE */
|
schemarouter_config_t schemarouter_config; /*< expanded config info from SERVICE */
|
||||||
int schemarouter_version;/*< version number for router's config */
|
int schemarouter_version;/*< version number for router's config */
|
||||||
unsigned int bitmask; /*< Bitmask to apply to server->status */
|
unsigned int bitmask; /*< Bitmask to apply to server->status */
|
||||||
|
Reference in New Issue
Block a user