Merge branch 'MXS-171' into develop
This commit is contained in:
@ -93,6 +93,13 @@ disable_sescmd_history=true
|
|||||||
disable_slave_recovery=true
|
disable_slave_recovery=true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**`master_accept_reads`** allows the master server to be used for reads. This is a useful option to enable if you are using a small number of servers and wish to use the master for reads as well.
|
||||||
|
|
||||||
|
```
|
||||||
|
# Use the master for reads
|
||||||
|
master_accept_reads=true
|
||||||
|
```
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
In Master-Slave replication cluster also read-only queries are routed to master too in the following situations:
|
In Master-Slave replication cluster also read-only queries are routed to master too in the following situations:
|
||||||
|
@ -252,6 +252,7 @@ typedef struct rwsplit_config_st {
|
|||||||
int rw_max_sescmd_history_size;
|
int rw_max_sescmd_history_size;
|
||||||
bool disable_sescmd_hist;
|
bool disable_sescmd_hist;
|
||||||
bool disable_slave_recovery;
|
bool disable_slave_recovery;
|
||||||
|
bool master_reads; /*< Use master for reads */
|
||||||
} rwsplit_config_t;
|
} rwsplit_config_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1244,7 +1244,8 @@ static bool get_dcb(
|
|||||||
SERVER_IS_SLAVE(b->backend_server) &&
|
SERVER_IS_SLAVE(b->backend_server) &&
|
||||||
(max_rlag == MAX_RLAG_UNDEFINED ||
|
(max_rlag == MAX_RLAG_UNDEFINED ||
|
||||||
(b->backend_server->rlag != MAX_RLAG_NOT_AVAILABLE &&
|
(b->backend_server->rlag != MAX_RLAG_NOT_AVAILABLE &&
|
||||||
b->backend_server->rlag <= max_rlag)))
|
b->backend_server->rlag <= max_rlag)) &&
|
||||||
|
!rses->rses_config.master_reads)
|
||||||
{
|
{
|
||||||
/** found slave */
|
/** found slave */
|
||||||
candidate_bref = &backend_ref[i];
|
candidate_bref = &backend_ref[i];
|
||||||
@ -4589,6 +4590,10 @@ static void rwsplit_process_router_options(
|
|||||||
{
|
{
|
||||||
router->rwsplit_config.disable_slave_recovery = config_truth_value(value);
|
router->rwsplit_config.disable_slave_recovery = config_truth_value(value);
|
||||||
}
|
}
|
||||||
|
else if(strcmp(options[i],"master_accept_reads") == 0)
|
||||||
|
{
|
||||||
|
router->rwsplit_config.master_reads = config_truth_value(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} /*< for */
|
} /*< for */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user