1

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.

[mysqld]
server_id=2
read_only=1
innodb_read_only=1

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.

replicate-ignore-table=mysql.gtid_slave_pos

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

kujiy
  • 466
  • 6
  • 11

3 Answers3

1

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.

Hannes
  • 301
  • 4
  • 9
1

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.

Gordan Bobić
  • 971
  • 4
  • 11
1

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.

lg.
  • 4,649
  • 3
  • 21
  • 20
  • 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. https://mariadb.com/kb/en/library/system-variable-differences-between-mariadb-100-and-mysql-56/#gtid_mode There will be a hint in here https://mariadb.com/kb/en/library/gtid/ but I'm not an English expart, so coudln't figure out it yet. – kujiy Nov 09 '17 at 00: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 09 '17 at 00:51