Bug#37276 maria crash on insert around the time check table is run

Fixed several (but not all) issues found by the test program:
- ASSERT on row_length in ma_blockrec.c::_ma_compact_block_page()
- Fixed bug when splitting node pages
- Fixed hang in 'closeing tables' (conflicting mutex order) by ensuring we first take trnman lock and then share->intern_lock

storage/maria/ma_blockrec.c:
  When compacting a row page when allocating space for a new row, the min length of a the new block may be temporarly smaller than 'min_block_length'.
storage/maria/ma_check.c:
  More DBUG output
storage/maria/ma_checkpoint.c:
  Call new function _ma_remove_not_visible_states_with_lock() to ensure we first take lock on trnman and then on share->intern_lock
  +
storage/maria/ma_close.c:
  Added comment
storage/maria/ma_open.c:
  Added comment
storage/maria/ma_search.c:
  Copy also node data; Caused bug when splitting node pages
storage/maria/ma_state.c:
  Added _ma_remove_not_visible_states_with_lock() to ensure we take locks in right order
storage/maria/ma_state.h:
  Added new prototype
storage/maria/trnman.c:
  Added trnman_lock() and trnman_unlock().
  Needed by _ma_remove_not_visible_states_with_lock() to get mutex in right order
storage/maria/trnman_public.h:
  Added new prototypes
This commit is contained in:
Michael Widenius 2008-07-05 14:03:21 +03:00
commit 82d7938905
10 changed files with 76 additions and 9 deletions

View file

@ -851,7 +851,7 @@ TrID trnman_get_max_trid()
}
/**
Check if there exist an active transaction between two commit_id's
@brief Check if there exist an active transaction between two commit_id's
@todo
Improve speed of this.
@ -885,3 +885,22 @@ my_bool trnman_exists_active_transactions(TrID min_id, TrID max_id,
pthread_mutex_unlock(&LOCK_trn_list);
return ret;
}
/**
lock transaction list
*/
void trnman_lock()
{
pthread_mutex_lock(&LOCK_trn_list);
}
/**
unlock transaction list
*/
void trnman_unlock()
{
pthread_mutex_unlock(&LOCK_trn_list);
}