facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.48k stars 714 forks source link

MyRocks: allow non-row binlog format if the SQL command may not gener… #1362

Closed laurynas-biveinis closed 1 year ago

laurynas-biveinis commented 1 year ago

…ate events

Currently, the SQL command type is not checked when making the decision to forbid statement and mixed binlog formats, but some SQL commands may not generate row events anyway, thus it does not make sense to forbid them. Add this condition by calling thd_sqlcom_can_generate_row_events(thd). InnoDB has been using a similar check already.

The difference may not be substantial at the moment, but with MyRocks DDSE many SQL commands start satisfying this condition.

At the same time partially reorganize ha_rocksdb::external_lock code so that things are not checked if they are not needed (i.e. binlog format only needs to be read for F_WRLCK lock type), and do early error exit checks before performing actions such as creating the transaction object.

laurynas-biveinis commented 1 year ago

@luqun, this is required for MyRocks DDSE

facebook-github-bot commented 1 year ago

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

luqun commented 1 year ago

beside refactor, the main change is to add thd_sqlcom_can_generate_row_events(). LGTM.

luqun commented 1 year ago

Committed the PR