Closed laurynas-biveinis closed 12 months ago
The pull request is ready for review but merging it will not result in a viable MyRocks DDSE (and will in fact break the existing DDSE = MyRocks testcases). All the code has been tested in another branch. The missing prerequisites for viable DDSE are
record[0]
/record[1]
issue for the handler delete_row
API@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Call it from create_key_defs for DD tables to get the pre-assigned index IDs in advance, as opposed to user tables where the index IDs are assigned later.
Why do DD tables need to get pre-assigned index IDs? could it also do similar as user tables? If I understand correctly, with myrocks private DD, DD tables can also get index IDs are assigned later. after removing myrocks private DD, then we need to get pre-assigned index IDs.
Call it from create_key_defs for DD tables to get the pre-assigned index IDs in advance, as opposed to user tables where the index IDs are assigned later.
Why do DD tables need to get pre-assigned index IDs? could it also do similar as user tables? If I understand correctly, with myrocks private DD, DD tables can also get index IDs are assigned later. after removing myrocks private DD, then we need to get pre-assigned index IDs.
The MySQL DD layer calls the pre-assignment code. I guess we could try making it a no-op and postpone the assignment until the handler create_table call, where the assignment could be re-unified with user table assignment.
Could you rebase this PR?
I guess we could try making it a no-op and postpone the assignment until the handler create_table call, where the assignment could be re-unified with user table assignment.
Yes. If we postpone the assignment, so all rocksdb table assignment will be unified..
@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.
Rebased. I will revisit the ID assignment after finishing my current task. One point requiring consideration there is that the DD/SE layer has the notion of "reset", making the IDs restart, which the MyRocks DD does not do. Yet, somehow the current code does not desync the IDs even though the server DD layer resets and the MyRocks DD does not.
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@luqun, I have looked into removing the private index ID assignment from ha_rocksdb::get_se_private_data
and leaving it to the MyRocks DD, as it currently does for the non-DD tables. In this approach, the MyRocks DD layer would have to return the assigned ID to the server layer, because all DD tables are expected to have their IDs assigned. This should be done by writing them to ha_rocksdb::create
argument dd::Table *table_def
. But there is a catch: in order for the DD layer to take any table_def
modifications into account, the handlerton must be declared with HTON_SUPPORTS_ATOMIC_DDL
flag (I guess because those table_def
changes become DD updates in a transaction, and if the DDL statement is aborted, they have to be rolled back together with any SE-made changes).
MyRocks is currently not a HTON_SUPPORTS_ATOMIC_DDL
engine. If/when it becomes one, we can revisit, but for the time being I'll cleanup this PR using the current design.
@luqun ready for review! These are close to final versions of handler/handlertons. A few TODOs in the code mostly related to the upgrade code paths.
No functional changes with InnoDB DDSE, safe to merge.
@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.
@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.
ha_rocksdb::get_se_private_data
about HTON_SUPPORTS_ATOMIC_DDL
.mysql_system_tables.sql
bit that created mysql.password_history
in MyRocks if DDSE == MyRocksthe MyRocks DD layer would have to return the assigned ID to the server layer, because all DD tables are expected to have their IDs assigned.
@laurynas-biveinis , Change LGTM. just curious, for "all DD tables are expected to have their IDs assigned", these IDs are se private id instead DD layer IDs. if myrocks doesn't return and also didn't check these IDs, then myrocks should be okay, is it?
@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
the MyRocks DD layer would have to return the assigned ID to the server layer, because all DD tables are expected to have their IDs assigned.
@laurynas-biveinis , Change LGTM. just curious, for "all DD tables are expected to have their IDs assigned", these IDs are se private id instead DD layer IDs. if myrocks doesn't return and also didn't check these IDs, then myrocks should be okay, is it?
@luqun, I had implemented that, the problem was that the server DD layer expects this property to be set
@luqun, the last changes to this PR were lost in the trunk push. Can you fix this or should I make a PR for the delta?
Implement MyRocks DDSE handler & handlerton methods