I set up a couple of maraidb v10.2.10 containers with the official docker image. Master can read/write and slave is read-only with this my.cnf.


Replication was working well for a while but it stopped with the following error:

Slave_IO_Running: Yes
Slave_SQL_Running: No
Last_Errno: 1942
Last_Error: Error during COMMIT: failed to update GTID state in mysql.gtid_slave_pos: 1036: Table 'gtid_slave_pos' is read only

I added this line into slave's my.cnf and set it up again from the beginning but still got the same error.


Does this mean that Innodb can't replicate to innodb-read-only server?


As well explained here slave should be read_only. Are you sure that nobody is trying to write to slave? Check if available the binlog.

  • Hi, thanks for your reply. I'm sure nobody tried to write to slave. The name of gtid_slave_pos seems to be used by slave itself to check the slave status. I believe slave itself wants to COMMIT. I thought I turned off the gtid_mode but mariadb doesn't have the variable. mariadb.com/kb/en/library/… There will be a hint in here mariadb.com/kb/en/library/gtid but I'm not an English expart, so coudln't figure out it yet. – kujiy Nov 9 '17 at 0:15
  • I added slave_skip_errors=1942 but still got the same error. I start to think this as a mariadb's bug. – kujiy Nov 9 '17 at 0:51

Got the same issue. Looks like innodb_read_only=1 prevents the replication. If you only set read_only=1 the replication is working fine.


The setting you are looking for is read_only, not innodb_read_only. The latter isn't for the use case you are describing, it is intended for data recovery operations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.