readwritesplit.c: corrected max_replication_lag with max_slave_replication_lag in hint parameter comparison functions.

This commit is contained in:
VilhoRaatikka
2014-08-01 18:30:40 +03:00
parent dfdd2cfccb
commit 76d7f3d836

View File

@ -1094,6 +1094,9 @@ static route_target_t get_route_target (
if (hint->type == HINT_ROUTE_TO_MASTER) if (hint->type == HINT_ROUTE_TO_MASTER)
{ {
target = TARGET_MASTER; /*< override */ target = TARGET_MASTER; /*< override */
LOGIF(LT, (skygw_log_write(
LOGFILE_TRACE,
"Hint: route to master.")));
break; break;
} }
else if (hint->type == HINT_ROUTE_TO_NAMED_SERVER) else if (hint->type == HINT_ROUTE_TO_NAMED_SERVER)
@ -1112,8 +1115,8 @@ static route_target_t get_route_target (
{ {
if (strncasecmp( if (strncasecmp(
(char *)hint->data, (char *)hint->data,
"max_replication_lag", "max_slave_replication_lag",
strlen("max_replication_lag")) == 0) strlen("max_slave_replication_lag")) == 0)
{ {
target |= TARGET_RLAG_MAX; target |= TARGET_RLAG_MAX;
} }
@ -1398,12 +1401,18 @@ static int routeQuery(
if (hint->type == HINT_ROUTE_TO_NAMED_SERVER) if (hint->type == HINT_ROUTE_TO_NAMED_SERVER)
{ {
named_server = hint->data; named_server = hint->data;
LOGIF(LT, (skygw_log_write(
LOGFILE_TRACE,
"Hint: route to server "
"'%s'",
named_server)));
} }
else if (hint->type == HINT_PARAMETER && else if (hint->type == HINT_PARAMETER &&
(strncasecmp( (strncasecmp(
(char *)hint->data, (char *)hint->data,
"max_replication_lag", "max_slave_replication_lag",
strlen("max_replication_lag")) == 0)) strlen("max_slave_replication_lag")) == 0))
{ {
int val = (int) strtol((char *)hint->data, int val = (int) strtol((char *)hint->data,
(char **)NULL, 10); (char **)NULL, 10);
@ -1411,6 +1420,11 @@ static int routeQuery(
if (val != 0 || errno == 0) if (val != 0 || errno == 0)
{ {
rlag_max = val; rlag_max = val;
LOGIF(LT, (skygw_log_write(
LOGFILE_TRACE,
"Hint: "
"max_slave_replication_lag=%d",
rlag_max)));
} }
} }
hint = hint->next; hint = hint->next;