Bug #105659 The statement is not true about the configuration of auth_cache_refresh_interval
Submitted: 22 Nov 2021 11:28 Modified: 7 Apr 22:58
Reporter: SUNIL SHAW Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Router Documentation Severity:S3 (Non-critical)
Version:8.0.27 OS:CentOS (8.4.2105)
Assigned to: CPU Architecture:x86 (Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz)
Tags: mysqlrouter

[22 Nov 2021 11:28] SUNIL SHAW
Description:
Hello Team,
Per MySQL router documentation, the values of auth_cache_refresh_interval variables should be smaller than auth_cache_ttl and ttl else Router won't start, which is not correct.

Reference:
https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-conf-options.html#option_mysqlr...

Error while configuring small value for auth_cache_refresh_interval:
Got below error:
2021-11-22 11:07:33 main ERROR [7fdf8c5bd780] Configuration error: 'auth_cache_refresh_interval' option value '2.000000' cannot be less than the 'ttl' value which is '15.000000

Thanks,
Sunil

How to repeat:
Install the mysql router by bootstrap:
mysqlrouter --bootstrap root@localhost:22629 --user=root --directory /tmp/myrouter --conf-use-sockets --account routerfriend --account-create always

Edit the /tmp/myrouter/mysqlrouter.conf with below contents:

[metadata_cache:myCluster]
cluster_type=gr
router_id=3
user=routerfriend
metadata_cluster=myCluster
ttl=15
auth_cache_ttl=-1
auth_cache_refresh_interval=2
use_gr_notifications=0

Trying to start the mysqlrouter by below command:
mysqlrouter -c /tmp/myrouter/mysqlrouter.conf

Got below error:
2021-11-22 11:07:33 main ERROR [7fdf8c5bd780] Configuration error: 'auth_cache_refresh_interval' option value '2.000000' cannot be less than the 'ttl' value which is '15.000000'

There is a contradiction of the statement between doc and error.

Suggested fix:
Please correct the sentence in doc.
https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-conf-options.html#option_mysqlr...
[23 Nov 2021 12:23] MySQL Verification Team
Hi,

Thanks for the report
[24 Nov 2021 9:20] Tomasz Stepniak
Posted by developer:
 
Those timers have the following relationship:
ttl <= auth_cache_refresh_interval <= auth_cache_ttl

To add a little context to this:
1. We cannot refresh the cache more frequently than ttl (ttl on our side is kind of a general refresh interval)
2. auth_cache_ttl is about expiring the authentication cache. It would make no sense to allow auth_cache_ttl smaller than auth_cache_refresh_interval because in that case cache would be invalidated over and over (we are unable to refresh it before it already expires).
[7 Apr 22:58] Philip Olson
Posted by developer:
 
Thank you Sunil for the helpful information, the documentation was updated accordingly for all three options.