• Marko Mäkelä's avatar
    MDEV-13684 InnoDB race condition between fil_crypt_thread and btr_scrub_init · 38ca9be4
    Marko Mäkelä authored
    There is a race condition in InnoDB startup. A number of
    fil_crypt_thread are created by fil_crypt_threads_init(). These threads
    may call btr_scrub_complete_space() before btr_scrub_init() was called.
    Those too early calls would be accessing an uninitialized scrub_stat_mutex.
    
    innobase_start_or_create_for_mysql(): Invoke btr_scrub_init() before
    fil_crypt_threads_init().
    
    fil_crypt_complete_rotate_space(): Only invoke btr_scrub_complete_space()
    if scrubbing is enabled. There is no need to update the statistics if
    it is not enabled.
    38ca9be4
btr0scrub.h 4.57 KB