• Marko Mäkelä's avatar
    MDEV-7962 wsrep_on() takes 0.14% in OLTP RO · edd38b50
    Marko Mäkelä authored
    The reason why we have wsrep_on() at all is that the macro WSREP(thd)
    depends on the definition of THD, and that is intentionally an opaque
    data type for InnoDB. So, we cannot avoid invoking wsrep_on(), but
    we can evaluate the less expensive conditions thd && WSREP_ON before
    calling the function.
    
    Global_read_lock: Use WSREP_NNULL(thd) instead of wsrep_on(thd)
    because we not only know the definition of THD but also that
    the pointer is not null.
    
    wsrep_open(): Use WSREP(thd) instead of wsrep_on(thd).
    
    InnoDB: Replace thd && wsrep_on(thd) with wsrep_on(thd), now that
    the condition has been merged to the definition of the macro
    wsrep_on().
    edd38b50
lock.cc 37.2 KB