diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2008-09-08 15:30:01 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2008-09-08 15:30:01 +0200 |
commit | 5b164964e2061c36724ee6841645d0cd4ae4114c (patch) | |
tree | 554ea3f971ce448804955bddfd67bba99788e7fd /sql/table.h | |
parent | 59edfa926118146e8f80d14b07ff1b5e0bca9d8d (diff) | |
download | mariadb-git-5b164964e2061c36724ee6841645d0cd4ae4114c.tar.gz |
Bug#38804: Query deadlock causes all tables to be inaccessible.
Problem was a mutex added in bug n 27405 for solving a problem
with auto_increment in partitioned innodb tables.
(in ha_partition::write_row over partitions file->ha_write_row)
Solution is to use the patch for bug#33479, which refines the
usage of mutexes for auto_increment.
Backport of bug-33479 from 6.0:
Bug-33479: auto_increment failures in partitioning
Several problems with auto_increment in partitioning
(with MyISAM, InnoDB. Locking issues, not handling
multi-row INSERTs properly etc.)
Changed the auto_increment handling for partitioning:
Added a ha_data variable in table_share for storage engine specific data
such as auto_increment value handling in partitioning, also see WL 4305
and using the ha_data->mutex to lock around read + update.
The idea is this:
Store the table's reserved auto_increment value in
the TABLE_SHARE and use a mutex to, lock it for reading and updating it
and unlocking it, in one block. Only accessing all partitions
when it is not initialized.
Also allow reservations of ranges, and if no one has done a reservation
afterwards, lower the reservation to what was actually used after
the statement is done (via release_auto_increment from WL 3146).
The lock is kept from the first reservation if it is statement based
replication and a multi-row INSERT statement where the number of
candidate rows to insert is not known in advance (like INSERT SELECT,
LOAD DATA, unlike INSERT VALUES (row1), (row2),,(rowN)).
This should also lead to better concurrancy (no need to have a mutex
protection around write_row in all cases)
and work with any local storage engine.
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h index da0e089794f..e5bc909d830 100644 --- a/sql/table.h +++ b/sql/table.h @@ -360,6 +360,7 @@ typedef struct st_table_share int cached_row_logging_check; #ifdef WITH_PARTITION_STORAGE_ENGINE + /** @todo: Move into *ha_data for partitioning */ bool auto_partitioned; const char *partition_info; uint partition_info_len; @@ -369,6 +370,9 @@ typedef struct st_table_share handlerton *default_part_db_type; #endif + /** place to store storage engine specific data */ + void *ha_data; + /* Set share's table cache key and update its db and table name appropriately. |