Description:
MEM agents try to EXPLAIN the statements they see.
However, on a read-only slave if you have a user which doesn't have full write privileges you can not do an EXPLAIN of such a statement. It generates an error.
That leaves a lot of confusing logging in the agent log files which are rather alarming.
How to repeat:
Run MEM3 agent on a MySQL server and enable QUAN for this server.
Run enough INSERTS, UPDATEs etc to trigger the errors when QUAN tries to EXPLAIN these statements.
Suggested fix:
The error message you get is quite clear:
User has only SELECT on this table:
simon@myhost [db]> EXPLAIN FORMAT=JSON INSERT INTO some_table ( id ) VALUES ( NULL );
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement
So ideally if you can recognise the type of statement and it seems to come from the replication threads and you get this error from MySQL while doing an explain then don't treat this as a problem, and log it.
I don't know if you can catch a similar but worrying configuration of an application actually trying (and failing) to do the same statement (ie. not the replication user) as reporting that as an error would make sense.