-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store DDL operations to VTMD #124
Comments
VTD table usage pattern is analogous to ACL tables for example (see |
1. table opened 1st time
2. table opened 2nd time
|
Another possible option is to try to use VTD as a log table (see |
|
NB: |
|
VTMD is now versioned table. |
CREATE TABLE ... LIKE ...
|
open_table_error()
|
MDL ticket required for
|
Ticket already exists on open
|
Requests are different, ticket is the same (
|
1. Ticket taken:
2. Assert failed
|
Create tableIB level``` #0 mtr_t::commit (this=0x7fffe5747db0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0mtr.cc:553 #1 0x00005555562e8d5f in dict_hdr_get_new_id (table_id=0x7fff8c01e960, index_id=0x0, space_id=0x0, table=0x7fff8c01e948, disable_redo=false) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0boot.cc:138 #2 0x00005555562f4f0b in dict_table_assign_new_id (table=0x7fff8c01e948, trx=0x7ffff403d2f8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0crea.cc:2800 #3 0x00005555562eed0c in dict_build_table_def_step (thr=0x7fff8c391460, node=0x7fff8c34c118) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0crea.cc:360 #4 0x00005555562f155c in dict_create_table_step (thr=0x7fff8c391460) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0crea.cc:1347 #5 0x000055555611644c in que_thr_step (thr=0x7fff8c391460) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1060 #6 0x00005555561165f4 in que_run_threads_low (thr=0x7fff8c391460) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1114 #7 0x00005555561167b4 in que_run_threads (thr=0x7fff8c391460) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1154 #8 0x000055555616e5f3 in row_create_table_for_mysql (table=0x7fff8c01e948, trx=0x7ffff403d2f8, commit=false, mode=FIL_ENCRYPTION_DEFAULT, key_id=1) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:2565 #9 0x000055555602e600 in create_table_info_t::create_table_def (this=0x7fffe5748ac0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:11964 #10 0x000055555601a76b in create_table_info_t::create_table (this=0x7fffe5748ac0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:13280 #11 0x000055555601b3b8 in ha_innobase::create (this=0x7fff8c38fea8, name=0x7fffe574ba10 "./test/d0", form=0x7fffe5749640, create_info=0x7fffe574bff0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:13604 ```
Rename tableIB level``` #0 mtr_t::commit (this=0x7fffe5748fb0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0mtr.cc:553 #1 0x00005555561a20b1 in row_sel (node=0x7fff88083260, thr=0x7fff880837e8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0sel.cc:2143 #2 0x00005555561a28de in row_sel_step (thr=0x7fff880837e8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0sel.cc:2399 #3 0x00005555561164b1 in que_thr_step (thr=0x7fff880837e8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1030 #4 0x00005555561167d8 in que_run_threads_low (thr=0x7fff880837e8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1114 #5 0x0000555556116998 in que_run_threads (thr=0x7fff880837e8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1154 #6 0x0000555556116c49 in que_eval_sql (info=0x7fff8806fe08, sql=0x5555568922d0 "PROCEDURE RENAME_TABLE () IS\nBEGIN\nUPDATE SYS_TABLES SET NAME = :new_table_name\n WHERE NAME = :old_table_name;\nEND;\n", reserve_dict_mutex=0, trx=0x7ffff403d2f8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1231 #7 0x00005555561737d4 in row_rename_table_for_mysql (old_name=0x7fffe574a2d0 "test/d0", new_name=0x7fffe574a0d0 "test/x0", trx=0x7ffff403d2f8, commit=true) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:4695 #8 0x000055555602f27d in innobase_rename_table (trx=0x7ffff403d2f8, from=0x7fffe574b290 "./test/d0", to=0x7fffe574b4a0 "./test/x0") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:14126 #9 0x000055555601ca11 in ha_innobase::rename_table (this=0x7fff880120b8, from=0x7fffe574b290 "./test/d0", to=0x7fffe574b4a0 "./test/x0") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:14238 ```
Drop tableIB level``` #0 mtr_t::commit (this=0x7fffe5748670) at /home/midenok/src/mariadb/midenok/src/storage/innobase/mtr/mtr0mtr.cc:553 #1 0x00005555561a21ba in row_sel (node=0x7fff88082e78, thr=0x7fff880833c8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0sel.cc:2183 #2 0x00005555561a28de in row_sel_step (thr=0x7fff880833c8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0sel.cc:2399 #3 0x00005555561164b1 in que_thr_step (thr=0x7fff880833c8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1030 #4 0x00005555561167d8 in que_run_threads_low (thr=0x7fff880833c8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1114 #5 0x0000555556116998 in que_run_threads (thr=0x7fff880833c8) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1154 #6 0x0000555556116c49 in que_eval_sql (info=0x7fff8807d9b8, sql=0x555556931c98 "PROCEDURE DELETE_FROM_TABLE_STATS () IS\nBEGIN\nDELETE FROM \"mysql/innodb_table_stats\" WHERE\ndatabase_name = :database_name AND\ntable_name = :table_name;\nEND;\n", reserve_dict_mutex=0, trx=0x7ffff403d7b0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/que/que0que.cc:1231 #7 0x0000555556329285 in dict_stats_exec_sql (pinfo=0x7fff8807d9b8, sql=0x555556931c98 "PROCEDURE DELETE_FROM_TABLE_STATS () IS\nBEGIN\nDELETE FROM \"mysql/innodb_table_stats\" WHERE\ndatabase_name = :database_name AND\ntable_name = :table_name;\nEND;\n", trx=0x7ffff403d7b0) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0stats.cc:311 #8 0x000055555632fdce in dict_stats_delete_from_table_stats (database_name=0x7fffe5748e00 "test", table_name=0x7fffe5748ed0 "d0") at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0stats.cc:3483 #9 0x0000555556330028 in dict_stats_drop_table (db_and_table=0x7fffe5749d40 "test/d0", errstr=0x7fffe57496e0 "", errstr_sz=1024) at /home/midenok/src/mariadb/midenok/src/storage/innobase/dict/dict0stats.cc:3568 #10 0x0000555556171506 in row_drop_table_for_mysql (name=0x7fffe5749d40 "test/d0", trx=0x7ffff403d2f8, drop_db=false, create_failed=0, nonatomic=true) at /home/midenok/src/mariadb/midenok/src/storage/innobase/row/row0mysql.cc:3792 #11 0x000055555601c2dc in ha_innobase::delete_table (this=0x7fff88011900, name=0x7fffe574ba00 "./test/d0") at /home/midenok/src/mariadb/midenok/src/storage/innobase/handler/ha_innodb.cc:13901 ```
|
Rename doesn't open table. Either need to open and check |
Table existence is checked by
|
On rename VTMD by old name is still accessible, though Table access by SELECT
No such table error
|
It doesn't enter into Table is removed from cache by |
|
Table create time: SELECT create_time FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'test'
AND table_name = 't0'; |
Fill
|
Rename via ALTER1. rename to
|
Create time from I_S:static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
LEX_STRING *db_name,
LEX_STRING *table_name)
{
...
if (file->stats.create_time)
{
thd->variables.time_zone->gmt_sec_to_TIME(&time,
(my_time_t) file->stats.create_time);
table->field[14]->store_time(&time);
table->field[14]->set_notnull();
} |
Table creation time as start (so-called VTMD recovery) is postponed until there will be better knowledge on VTQ timestamp tampering. |
IB: Fixes in logic when to do versioned or usual row updates. Now it is able to do unversioned updates for versioned tables just by disabling `TABLE_SHARE::versioned` flag. SQL: DDL tracking for: * RENAME TABLE, ALTER TABLE .. RENAME TO; * DROP TABLE; * data-modifying operations (f.ex. ALTER TABLE .. ADD/DROP COLUMN).
Track DDL operations:
in VTMD table.
Branch: am/124-vtmd
TODO
archive_name
for renames before ALTER;name
;Testing
The text was updated successfully, but these errors were encountered: