Merge branch '2.1.0' into 2.1

This commit is contained in:
Markus Mäkelä
2017-02-08 09:30:34 +02:00
8 changed files with 25 additions and 53 deletions

View File

@ -231,5 +231,7 @@ executed in separate parts.
query will be routed to the first available server. This possibly returns an query will be routed to the first available server. This possibly returns an
error about database rights instead of a missing database. error about database rights instead of a missing database.
* As text protocol prepared statements are relatively rare, prepared statements * The preparation of a prepared statement is routed to all servers. The
are not supported in schemarouter. execution of a prepared statement is routed to the first available server or to
the server pointed by a routing hint attached to the query. In practice this
means that prepared statements aren't supported by the schemarouter.

View File

@ -589,42 +589,6 @@ filters=counter | QLA
The requests pass through the filters from left to right in the order defined in The requests pass through the filters from left to right in the order defined in
the configuration parameter. the configuration parameter.
#### `monitor`
The monitor parameter tells the service which cluster of servers to use. The
value of the option is the name of a monitor object. This removes the redundant
definition of servers in both services and monitors.
If both the `monitor` and `servers` parameters are defined, only the `monitor`
parameter will be used.
Only one cluster can be defined for a service. Multi-cluster setups should use
the `servers` parameter to list the servers that the service should use.
Here is an excerpt from an example configuration with a service that defines the
cluster parameter.
```
[db-cluster-1-monitor]
type=monitor
module=mysqlmon
servers=server1,server2,server3
user=maxuser
passwd=maxpwd
monitor_interval=1000
[my-readwrite-service]
type=service
router=readwritesplit
monitor=db-cluster-1-monitor
user=maxuser
passwd=maxpwd
```
The _db-cluster-1-monitor_ cluster consists of three servers monitored by a
_mysqlmon_ monitor module. The _my-readwrite-service_ uses this monitor as the
source for servers.
#### `servers` #### `servers`
The servers parameter in a service definition provides a comma separated list of The servers parameter in a service definition provides a comma separated list of

View File

@ -1,4 +1,4 @@
# MariaDB MaxScale 2.0.4 Release Notes # MariaDB MaxScale 2.0.4 Release Notes -- 2017-02-01
Release 2.0.4 is a GA release. Release 2.0.4 is a GA release.

View File

@ -188,15 +188,6 @@ allowing runtime tuning of parameters.
- `destroy monitor`: Destroy a created monitor - `destroy monitor`: Destroy a created monitor
- `alter monitor`: Alter monitor parameters - `alter monitor`: Alter monitor parameters
### Monitors as server sources for services
Services now accept a `monitor` parameter which can be used to point a service
to a cluster of servers that are monitored by a monitor. The value of the
`monitor` parameter should be the name of a monitor in the configuration name.
For more details, refer to the [Configuration
Guide](../Getting-Started/Configuration-Guide.md#cluster) section on clusters.
### Module commands ### Module commands
Introduced in MaxScale 2.1, the module commands are special, module-specific Introduced in MaxScale 2.1, the module commands are special, module-specific

View File

@ -90,7 +90,7 @@ typedef struct server_ref_t
#define SERVICE_MAX_RETRY_INTERVAL 3600 /*< The maximum interval between service start retries */ #define SERVICE_MAX_RETRY_INTERVAL 3600 /*< The maximum interval between service start retries */
/** Value of service timeout if timeout checks are disabled */ /** Value of service timeout if timeout checks are disabled */
#define SERVICE_NO_SESSION_TIMEOUT LONG_MAX #define SERVICE_NO_SESSION_TIMEOUT 0
/** /**
* Parameters that are automatically detected but can also be configured by the * Parameters that are automatically detected but can also be configured by the
@ -145,7 +145,7 @@ typedef struct service
SERVICE_REFRESH_RATE rate_limit; /**< The refresh rate limit for users table */ SERVICE_REFRESH_RATE rate_limit; /**< The refresh rate limit for users table */
MXS_FILTER_DEF **filters; /**< Ordered list of filters */ MXS_FILTER_DEF **filters; /**< Ordered list of filters */
int n_filters; /**< Number of filters */ int n_filters; /**< Number of filters */
long conn_idle_timeout; /**< Session timeout in seconds */ uint64_t conn_idle_timeout; /**< Session timeout in seconds */
char *weightby; /**< Service weighting parameter name */ char *weightby; /**< Service weighting parameter name */
struct service *next; /**< The next service in the linked list */ struct service *next; /**< The next service in the linked list */
bool retry_start; /**< If starting of the service should be retried later */ bool retry_start; /**< If starting of the service should be retried later */

View File

@ -3485,7 +3485,9 @@ void dcb_process_idle_sessions(int thr)
{ {
MXS_SESSION *session = dcb->session; MXS_SESSION *session = dcb->session;
if (session->service && session->client_dcb && session->client_dcb->state == DCB_STATE_POLLING && if (session->service && session->client_dcb &&
session->client_dcb->state == DCB_STATE_POLLING &&
session->service->conn_idle_timeout &&
hkheartbeat - session->client_dcb->last_read > session->service->conn_idle_timeout * 10) hkheartbeat - session->client_dcb->last_read > session->service->conn_idle_timeout * 10)
{ {
poll_fake_hangup_event(dcb); poll_fake_hangup_event(dcb);

View File

@ -68,7 +68,12 @@ bool avro_open_binlog(const char *binlogdir, const char *file, int *dest)
if ((fd = open(path, O_RDONLY)) == -1) if ((fd = open(path, O_RDONLY)) == -1)
{ {
MXS_ERROR("Failed to open binlog file %s.", path); if (errno != ENOENT)
{
char err[MXS_STRERROR_BUFLEN];
MXS_ERROR("Failed to open binlog file %s: %d, %s", path, errno,
strerror_r(errno, err, sizeof(err)));
}
return false; return false;
} }

View File

@ -479,7 +479,15 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size)
if (ptr > start) if (ptr > start)
{ {
/** Valid identifier */ /** Valid identifier */
snprintf(dest, size, "%.*s", (int)(ptr - start), start); size_t bytes = ptr - start;
if (bt)
{
bytes--;
}
memcpy(dest, start, bytes);
dest[bytes] = '\0';
make_valid_avro_identifier(dest); make_valid_avro_identifier(dest);
ptr = next_field_definition(ptr); ptr = next_field_definition(ptr);