Completion to fix for http://bugs.skysql.com/show_bug.cgi?id=547
server.h:added macro SERVER_IS_ROOT_MASTER for finding valid candidate for root master readwritesplit.c: wrote open three if conditions in get_root_master_bref for clarity
This commit is contained in:
@ -123,7 +123,15 @@ typedef struct server {
|
||||
*/
|
||||
#define SERVER_IS_MASTER(server) \
|
||||
(((server)->status & (SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE|SERVER_MAINT)) == (SERVER_RUNNING|SERVER_MASTER))
|
||||
|
||||
/**
|
||||
* Is the server valid candidate for root master. The server must be running,
|
||||
* marked as master and not have maintenance bit set.
|
||||
*/
|
||||
#define SERVER_IS_ROOT_MASTER(server) \
|
||||
(((server)->status & (SERVER_RUNNING|SERVER_MASTER|SERVER_MAINT)) == (SERVER_RUNNING|SERVER_MASTER))
|
||||
|
||||
/**
|
||||
* Is the server a slave? The server must be both running and marked as a slave
|
||||
* in order for the macro to return true
|
||||
*/
|
||||
|
Reference in New Issue
Block a user