From 76d7f3d836f56b225a827658604031956830a6af Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Fri, 1 Aug 2014 18:30:40 +0300 Subject: [PATCH] readwritesplit.c: corrected max_replication_lag with max_slave_replication_lag in hint parameter comparison functions. --- .../routing/readwritesplit/readwritesplit.c | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index ac57ab1c9..a6a67d9dc 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -1094,6 +1094,9 @@ static route_target_t get_route_target ( if (hint->type == HINT_ROUTE_TO_MASTER) { target = TARGET_MASTER; /*< override */ + LOGIF(LT, (skygw_log_write( + LOGFILE_TRACE, + "Hint: route to master."))); break; } else if (hint->type == HINT_ROUTE_TO_NAMED_SERVER) @@ -1112,8 +1115,8 @@ static route_target_t get_route_target ( { if (strncasecmp( (char *)hint->data, - "max_replication_lag", - strlen("max_replication_lag")) == 0) + "max_slave_replication_lag", + strlen("max_slave_replication_lag")) == 0) { target |= TARGET_RLAG_MAX; } @@ -1398,12 +1401,18 @@ static int routeQuery( if (hint->type == HINT_ROUTE_TO_NAMED_SERVER) { named_server = hint->data; + LOGIF(LT, (skygw_log_write( + LOGFILE_TRACE, + "Hint: route to server " + "'%s'", + named_server))); + } else if (hint->type == HINT_PARAMETER && (strncasecmp( (char *)hint->data, - "max_replication_lag", - strlen("max_replication_lag")) == 0)) + "max_slave_replication_lag", + strlen("max_slave_replication_lag")) == 0)) { int val = (int) strtol((char *)hint->data, (char **)NULL, 10); @@ -1411,6 +1420,11 @@ static int routeQuery( if (val != 0 || errno == 0) { rlag_max = val; + LOGIF(LT, (skygw_log_write( + LOGFILE_TRACE, + "Hint: " + "max_slave_replication_lag=%d", + rlag_max))); } } hint = hint->next;