From aa828e87511b4668073c2a822b2783b985fd6dea Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Mon, 30 Jun 2014 09:00:43 +0200 Subject: [PATCH] Added missing comment to get_root_master Added missing comment to get_root_master --- .../routing/readwritesplit/readwritesplit.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index db298db4e..0bfd1b4f7 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -3264,7 +3264,20 @@ static bool prep_stmt_drop( } #endif /*< PREP_STMT_CACHING */ - +/******************************** + * This routine return the root master server from MySQL replication tree + * Get the root Master rule: + * + * (1) find server(s) with lowest replication depth level + * (2) check for SERVER_MASTER bitvalue in those servers + * Servers are checked even if they are in 'maintenance' + * SERVER_IS_DOWN is the only status to skip. + * + * @param servers The list of servers + * @param The number of servers + * @return The Master found + * + */ static BACKEND *get_root_master(backend_ref_t *servers, int router_nservers) { int i = 0; BACKEND * master_host = NULL;