MXS-400: Servers that are both master and slave now work with readwritesplit
The check for the server status explicitly denied servers that are both master and slave from being chosed as candidates for queries. This is only a problem when a user manually sets the server states to both master and slave. The monitors resolve the replication topology based on the servers that the monitors see and this always results in at least one slave server.
This commit is contained in:
@ -148,7 +148,7 @@ typedef struct server {
|
||||
#define SERVER_IS_MASTER(server) SRV_MASTER_STATUS((server)->status)
|
||||
|
||||
#define SRV_MASTER_STATUS(status) ((status & \
|
||||
(SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE|SERVER_MAINT)) == \
|
||||
(SERVER_RUNNING|SERVER_MASTER|SERVER_MAINT)) == \
|
||||
(SERVER_RUNNING|SERVER_MASTER))
|
||||
|
||||
/**
|
||||
@ -163,7 +163,7 @@ typedef struct server {
|
||||
* in order for the macro to return true
|
||||
*/
|
||||
#define SERVER_IS_SLAVE(server) \
|
||||
(((server)->status & (SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE|SERVER_MAINT)) == \
|
||||
(((server)->status & (SERVER_RUNNING|SERVER_SLAVE|SERVER_MAINT)) == \
|
||||
(SERVER_RUNNING|SERVER_SLAVE))
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user