mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
branches/zip:
Add the proper macros for checking the correct latching order in trx information_schema code. Approved by: Marko
This commit is contained in:
parent
23b5958255
commit
5ccc74c515
3 changed files with 18 additions and 5 deletions
|
@ -383,9 +383,10 @@ or row lock! */
|
|||
their level set after the page is
|
||||
locked; see e.g.
|
||||
ibuf_bitmap_get_map_page(). */
|
||||
#define SYNC_INFORMATION_SCHEMA 1900 /* Used when latching
|
||||
INFORMATION SCHEMA internal
|
||||
structures. */
|
||||
#define SYNC_TRX_I_S_RWLOCK 1910 /* Used for
|
||||
trx_i_s_cache_t::rw_lock */
|
||||
#define SYNC_TRX_I_S_LAST_READ 1900 /* Used for
|
||||
trx_i_s_cache_t::last_read_mutex */
|
||||
#define SYNC_DICT_OPERATION 1001 /* table create, drop, etc. reserve
|
||||
this in X-mode, implicit or backround
|
||||
operations purge, rollback, foreign
|
||||
|
|
|
@ -1036,6 +1036,8 @@ sync_thread_add_level(
|
|||
case SYNC_DICT_AUTOINC_MUTEX:
|
||||
case SYNC_DICT_OPERATION:
|
||||
case SYNC_DICT_HEADER:
|
||||
case SYNC_TRX_I_S_RWLOCK:
|
||||
case SYNC_TRX_I_S_LAST_READ:
|
||||
if (!sync_thread_levels_g(array, level)) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: sync_thread_levels_g(array, %lu)"
|
||||
|
|
|
@ -834,11 +834,21 @@ trx_i_s_cache_init(
|
|||
/*===============*/
|
||||
trx_i_s_cache_t* cache) /* out: cache to init */
|
||||
{
|
||||
rw_lock_create(&cache->rw_lock, SYNC_INFORMATION_SCHEMA);
|
||||
/* The latching is done in the following order:
|
||||
acquire trx_i_s_cache_t::rw_lock, X
|
||||
acquire kernel_mutex
|
||||
release kernel_mutex
|
||||
release trx_i_s_cache_t::rw_lock
|
||||
acquire trx_i_s_cache_t::rw_lock, S
|
||||
acquire trx_i_s_cache_t::last_read_mutex
|
||||
release trx_i_s_cache_t::last_read_mutex
|
||||
release trx_i_s_cache_t::rw_lock */
|
||||
|
||||
rw_lock_create(&cache->rw_lock, SYNC_TRX_I_S_RWLOCK);
|
||||
|
||||
cache->last_read = 0;
|
||||
|
||||
mutex_create(&cache->last_read_mutex, SYNC_INFORMATION_SCHEMA);
|
||||
mutex_create(&cache->last_read_mutex, SYNC_TRX_I_S_LAST_READ);
|
||||
|
||||
table_cache_init(&cache->innodb_trx, sizeof(i_s_trx_row_t));
|
||||
table_cache_init(&cache->innodb_locks, sizeof(i_s_locks_row_t));
|
||||
|
|
Loading…
Reference in a new issue