• Marko Mäkelä's avatar
    MDEV-34515: Reduce context switching in purge · 76f6b6d8
    Marko Mäkelä authored
    Before this patch, the InnoDB purge coordinator task submitted
    innodb_purge_threads-1 tasks even if there was not sufficient amount
    of work for all of them. For example, if there are undo log records
    only for 1 table, only 1 task can be employed, and that task had better
    be the purge coordinator.
    
    srv_purge_worker_task_low(): Split from purge_worker_callback().
    
    trx_purge_attach_undo_recs(): Remove the parameter n_purge_threads,
    and add the parameter n_work_items, to keep track of the amount of
    work.
    
    trx_purge(): Launch purge worker tasks only if necessary. The work of
    one thread will be executed by this purge coordinator thread.
    
    que_fork_scheduler_round_robin(): Merged to trx_purge().
    
    Thanks to Vladislav Vaintroub for supplying a prototype of this.
    
    Reviewed by: Debarun Banerjee
    76f6b6d8
trx0purge.cc 44.2 KB