Probably this is by design, but I just noted that readwritesplit router consider any SELECT ... INTO OUTFILE statement as "session command" and route them to all back end servers. This is NOT explicitly documented in KB, https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-22-readwritesplit/
It seems that even if we put the statement into transaction, file is still created on all back ends. I see the following problems with this design:
1. SELECT that can read and write a lot of data is executed on every back end even this is not needed/intended. This is a waste of resources.
2. If back ends are running on the same OS or use shared filesystem, writes on some of them fail as file exists, but we do not get any warning or error while on at least one of back end servers this statement is completed successfully. Sessions on toehr back ends get closed:
So, please, document current design if this is intended feature and provide some option/way to route such queries only to Master or any back end server specified by the hint.