• Marko Mäkelä's avatar
    MDEV-19408 Assertion on trx->state failed in ReadView::copy_trx_ids · e0271a7b
    Marko Mäkelä authored
    ReadView::copy_trx_ids(): Relax a debug check. It failed to account for
    TRX_STATE_PREPARED_RECOVERED, which was introduced in MDEV-15772.
    It was also reading trx->state twice and failed to tolerate
    TRX_STATE_COMMITTED_IN_MEMORY, which could be concurrently assigned
    in lock_trx_release_locks(), which is not holding trx_sys->mutex.
    
    This bug is specific to the MariaDB 10.2 series. The ReadView was
    introduced in MariaDB 10.2.2 by merging the code that had been
    introduced in MySQL 5.7.2. In MariaDB 10.3, ReadView::snapshot()
    would use the lock-free trx_sys.rw_trx_hash. MDEV-14638 moved the
    corresponding assertion to trx_sys_t::find(), where it was duly
    protected by trx->mutex, and later MDEV-14756 moved the check to
    rw_trx_hash_t::validate_element(). This check was correctly adjusted
    when MDEV-15772 was merged to 10.3.
    e0271a7b
read0read.cc 19.3 KB