• Michael Widenius's avatar
    MDEV-3999: Valgrind errors 'invalid write' or assorted server crashes on... · 3bd6e4b8
    Michael Widenius authored
    MDEV-3999: Valgrind errors 'invalid write' or assorted server crashes on concurrent flow with partitioned Aria tables
    MDEV-3989: Server crashes on import from MariaDB mysqldump export with partitioned Aria table.
    
    Problem was that bulk insert in aria was not properly protected against concurrent selects.
    
    
    storage/maria/ha_maria.cc:
      Move settings of file->state to _ma_block_start_trans() to ensure that lock_key_trees is not changed by a concurrent bulk_insert.
    storage/maria/ma_check.c:
      Added DBUG_ASSERT()
    storage/maria/ma_open.c:
      Set start_trans to ma_start_trans for default behaviour.
    storage/maria/ma_pagecrc.c:
      Removed test for 'non_transactional' as a now_transactinal could be reset while a flush was happening.
    storage/maria/ma_state.c:
      Moved setting of info->state from external_lock to start_trans to protect against concurrent running bulk inserts.
      This works as the other threads will wait in thr_lock() until bulk_insert is done and keys are re-generated.
    storage/maria/ma_state.h:
      Added _ma_start_trans()
    3bd6e4b8
ma_state.c 24.2 KB