Allow infinite refreshes of users

The hard limit of 10 seconds is too strict when taking into account the
fact that infinite refreshes was possible before the bug was fixed. This
also makes testing a lot easier where rapid reloads are necessary.
This commit is contained in:
Markus Mäkelä 2019-07-10 10:01:43 +03:00
parent 21dfcb5648
commit 9de06a52b0
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
4 changed files with 7 additions and 12 deletions

View File

@ -867,13 +867,17 @@ MaxScale will at startup load the users from the backend server, but if
the authentication of a user fails, MaxScale assumes it is because a new
user has been created and will thus refresh the users. By default, MaxScale
will do that at most once per 30 seconds and with this configuration option
that can be changed. The minimum allowed value is 10 seconds. A negative
that can be changed. A value of 0 allows infinite refreshes and a negative
value disables the refreshing entirelly. Note that using `maxadmin` it is
possible to explicitly cause the users of a service to be reloaded.
```
users_refresh_time=120
```
In MaxScale 2.3.9 and older versions, the minimum allowed value was 10 seconds
but, due to a bug, the default value was 0 which allowed infinite refreshes.
### `retain_last_statements`
How many statements MaxScale should store for each session. This is for

View File

@ -83,7 +83,6 @@ typedef struct server_ref_t
/* Refresh rate limits for load users from database */
#define USERS_REFRESH_TIME_DEFAULT 30 /* Allowed time interval (in seconds) after last update*/
#define USERS_REFRESH_TIME_MIN 10 /* Minimum allowed time interval (in seconds)*/
/** Default timeout values used by the connections which fetch user authentication data */
#define DEFAULT_AUTH_CONNECT_TIMEOUT 3

View File

@ -1,5 +1,6 @@
[maxscale]
threads=###threads###
users_refresh_time=0
[rwsplit-service]
type=service

View File

@ -2337,7 +2337,7 @@ static int handle_global_item(const char* name, const char* value)
return 0;
}
decltype(gateway.qc_cache_properties.max_size)max_size = int_value;
decltype(gateway.qc_cache_properties.max_size) max_size = int_value;
if (max_size >= 0)
{
@ -2515,15 +2515,6 @@ static int handle_global_item(const char* name, const char* value)
// but I just don't beleave the uptime will be that long.
users_refresh_time = INT32_MAX;
}
else if (users_refresh_time < USERS_REFRESH_TIME_MIN)
{
MXS_WARNING("%s is less than the allowed minimum value of %d for the "
"configuration option '%s', using the minimum value.",
value,
USERS_REFRESH_TIME_MIN,
CN_USERS_REFRESH_TIME);
users_refresh_time = USERS_REFRESH_TIME_MIN;
}
if (users_refresh_time > INT32_MAX)
{