facebook / mysql-5.6

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

[dd] enable change ddse from innodb to rocksdb #1354

Closed luqun closed 9 months ago

luqun commented 10 months ago

Summary:

The change is to "upgrade" DD tables from innodb SE to rocksdb SE.

Steps for a DD table involving DDSE change: apply to all DD tables

- create target DD tables into <upgrade> schema by execute "Create table"
- 'logical copy': execute "INSERT INTO <upgrade>.<Table> SELECT * FROM mysql.<Table>" 
- "rename" mysql.<Table> to <temporary>.<Table> and "rename" <upgrade>.<Table> to mysql.<Table>

Workflow for innodb SE to rocksdb SE changes

- create a schema for target DD tables(such as <upgrade>) and create another schema for temporary usage(such as <temporary>
- upgrade dd_properties table
- upgrade other DD tables
- update DD_ENGINE/VERSION property in dd_properties table and  commit changes with one trx
- drop <temporary> schema

The above workflow for INNODB->ROCKSDB DDSE change is finished with two writebatch commit first and one transaction commit

If V1, V2, V3 are equal, then SKIP DD table change; otherwise, try DD table change

During DDSE change, if crash occurs, what's next?

Crash Scenarios during INNODB->ROCKSDB DDSE change

Remaining issues:

laurynas-biveinis commented 10 months ago

@luqun , is this ready for review?

luqun commented 10 months ago

@luqun , is this ready for review? Yes. maybe I shouldn't force push?

laurynas-biveinis commented 10 months ago

@luqun , is this ready for review? Yes. maybe I shouldn't force push?

Force pushes are fine with me

facebook-github-bot commented 9 months ago

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

luqun commented 9 months ago

committed