• Marko Mäkelä's avatar
    MDEV-24671: Replace lock_wait_timeout_task with mysql_cond_timedwait() · e71e6133
    Marko Mäkelä authored
    lock_wait(): Replaces lock_wait_suspend_thread(). Wait for the lock to
    be granted or the transaction to be killed using mysql_cond_timedwait()
    or mysql_cond_wait().
    
    lock_wait_end(): Replaces que_thr_end_lock_wait() and
    lock_wait_release_thread_if_suspended().
    
    lock_wait_timeout_task: Remove. The operating system kernel will
    resume the mysql_cond_timedwait() in lock_wait(). An added benefit
    is that innodb_lock_wait_timeout no longer has a 'jitter' of 1 second,
    which was caused by this wake-up task waking up only once per second,
    and then waking up any threads for which the timeout (which was only
    measured in seconds) was exceeded.
    
    innobase_kill_query(): Set trx->error_state=DB_INTERRUPTED,
    so that a call trx_is_interrupted(trx) in lock_wait() can be avoided.
    
    We will protect things more consistently with lock_sys.wait_mutex,
    which will be moved below lock_sys.mutex in the latching order.
    
    trx_lock_t::cond: Condition variable for !wait_lock, used with
    lock_sys.wait_mutex.
    
    srv_slot_t: Remove. Replaced by trx_lock_t::cond,
    
    lock_grant_after_reset(): Merged to to lock_grant().
    
    lock_rec_get_index_name(): Remove.
    
    lock_sys_t: Introduce wait_pending, wait_count, wait_time, wait_time_max
    that are protected by wait_mutex.
    
    trx_lock_t::que_state: Remove.
    
    que_thr_state_t: Remove QUE_THR_COMMAND_WAIT, QUE_THR_LOCK_WAIT.
    
    que_thr_t: Remove is_active, start_running(), stop_no_error().
    
    que_fork_t::n_active_thrs, trx_lock_t::n_active_thrs: Remove.
    e71e6133
srv0srv.cc 63.7 KB