1

Currently, master-slave replication is finished, and select and insert are branched using the readwritesplit function of maxscale.

I was using common dbcp and checking the connection using the options of testOnBorrow and validationQuery through datasource configuration, but because the query is transmitted through maxscale, select 1 of validationQuery is only transmitted to the slave, and the connection validity of the master cannot be checked.

The master does not check the validity of the connection, so if you connect after not using WAS for a long time, a db connection related error occurs.

to solve this problem I used master_accept_reads = true, but I don't want to use it as it will generate more traffic to the master. As another option persistpoolmax,persistmaxtime I used, but I got the same error message.

I am wondering if there is a way to send a connection validation query such as ValidationQuery in maxscale or mariadb without distinction between master and slave.

Thank you for reading the long text.

kimGT
  • 11
  • 1

1 Answers1

0

You can use the hint filter to route queries to the master.

https://mariadb.com/kb/en/mariadb-maxscale-24-hintfilter/

tcoker
  • 21
  • 2
  • The hint filter was understood as sending a query to the master unconditionally for a select that occurs immediately after a specific insert to return the latest data when there is a replication delay in the master slave. I want to send a query to both the master slave when the query called select 1 is executed, but I couldn't find if it could be filtered. – kimGT Nov 26 '20 at 07:39