Focal has MySQL version 8.0.20-0ubuntu0.20.04.1 which sets
group_replication_member_expel_timeout to 0 by default [0]. As a result,
cluster members are expelled from the cluster 5 seconds after the loss
of connectivity.
This proves to be too short for our CI and some other environments in
the wild.
MySQL documentation for this option suggests that 5 or even 10 seconds
may be too low for congested or overcommitted environments which happens
to be the case. As of MySQL 8.0.21 the default for
group_replication_member_expel_timeout is set to 5 seconds.
This PR should only speed up charm hook execution be reusing database
connections. Tested with ~35 client units connected to the shared-db
relation and execution time of db_router_respond dripped from >5mins
to ~1min.