[MDEV-17045] MyRocks tables cannot be updated when binlog_format=MIXED. Created: 2018-08-23 Updated: 2019-06-18 Resolved: 2019-06-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.2.25, 10.3.16, 10.4.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
One cannot update a MyRocks table when they have binlog_format=MIXED:
This doesn't make sense from a user perspective:
|
| Comments |
| Comment by Sergei Petrunia [ 2018-08-23 ] | ||||||||||||||||||||||||
|
Internally, it looks like this: ha_rocksdb::table_flags() advertises that the storage engine supports both kinds of binlogging:
So if the SQL layer has logic to "use SBR if binlog_format=MIXED but storage engine doesn't support it", it will not be applied. The statement proceeds to execute and hits this piece in ha_rocksdb::external_lock:
when invoked from here:
and this is why the statement fails with an error. | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-08-23 ] | ||||||||||||||||||||||||
|
Possible solutions:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-06-15 ] | ||||||||||||||||||||||||
|
Following discussion with monty, considering a fix where ha_rocksdb::table_flags() will not return HA_BINLOG_STMT_CAPABLE flag. If we do that, the SQL layer will be able to switch to using RBR for statements that modify MyRocks tables. | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-06-15 ] | ||||||||||||||||||||||||
|
A related variable:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-06-15 ] | ||||||||||||||||||||||||
|
Currently, the check implements this logic: SBR is allowed if:
(this way, if the master had @@rocksdb_unsafe_for_binlog=1, the slave will be able to run this, even if the slave itself has @@rocksdb_unsafe_for_binlog=0, and is not aware that the master had this setting). | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-06-15 ] | ||||||||||||||||||||||||
|
Branch: bb-10.2-mdev17045 |