• Nirbhay Choubey's avatar
    MDEV-8208: Sporadic SEGFAULT on startup · db2e21bf
    Nirbhay Choubey authored
    Problem:
    When mysqld starts as a galera node, it creates 2 system threads
    (applier & rollbacker) using start_wsrep_THD(). These threads are
    created before plugin initialization (plugin_init()) for SST methods
    like rsync and xtrabackup.
    
    The threads' initialization itself can proceed in parallel to mysqld's
    main thread of execution. As a result, the thread initialization code
    (start_wsrep_THD()) can end up accessing some un/partially initialized
    structures (like maria_hton, in this particular case) resulting in
    segfault.
    
    Solution:
    Fixed by calling THD::init_for_queries() (which accesses maria_hton)
    only after the plugins have been initialized.
    db2e21bf
wsrep_mysqld.h 12.2 KB