Skip to content
  • Magnus Blåudd's avatar
    ec284437
    Bug#27538139 MAX_EXECUTION_TIME HINT DOESN'T WORK IF WAITING ON · ec284437
    Magnus Blåudd authored
    NDBCLUSTER GLOBAL SCHEMA LOCK
    
    When running a query on I_S.TABLES an endless loop is entered while
    waiting for global schema lock to be available. It's not possible to
    kill the query, have the query "kill itself" using the
    MAX_EXECUTION_TIME optimizer hint nor using --max-execution--time
    variable.
    
    Problem occurs when the attempt to acquire the GSL row-lock failed due
    to do deadlock detection timeout error in NDB. The query is then choosen
    as "victimized", causing endless retries without checking the killed
    flag. Both DDL and `SELECT ... FROM I_S.TABLES` queries are affected.
    
    Fix by checking the killed flag and terminate the retry loop.
    
    Also add an optimisation to ndbcluster_find_files() making it check the
    killed flag and return immediately, this significantly reduces total time
    for I_S.TABLES queries to terminate.
    
    Also fix a problem with calling unlock after error which causes variable
    underflow. Theoretically it should not be necessary to call unlock when
    lock failed, but it's currently not possible to eliminate the unlock
    call.
    
    Add tests for global schema lock in combination with SELECT I_S.TABLES
    query using MAX_EXECUTION_TIME as well as DDL query being killed while
    waiting for global schema lock.
    
    Change-Id: If9e5c9787c347c400a66d2edf00cc59abe993419
    ec284437
    Bug#27538139 MAX_EXECUTION_TIME HINT DOESN'T WORK IF WAITING ON
    Magnus Blåudd authored
    NDBCLUSTER GLOBAL SCHEMA LOCK
    
    When running a query on I_S.TABLES an endless loop is entered while
    waiting for global schema lock to be available. It's not possible to
    kill the query, have the query "kill itself" using the
    MAX_EXECUTION_TIME optimizer hint nor using --max-execution--time
    variable.
    
    Problem occurs when the attempt to acquire the GSL row-lock failed due
    to do deadlock detection timeout error in NDB. The query is then choosen
    as "victimized", causing endless retries without checking the killed
    flag. Both DDL and `SELECT ... FROM I_S.TABLES` queries are affected.
    
    Fix by checking the killed flag and terminate the retry loop.
    
    Also add an optimisation to ndbcluster_find_files() making it check the
    killed flag and return immediately, this significantly reduces total time
    for I_S.TABLES queries to terminate.
    
    Also fix a problem with calling unlock after error which causes variable
    underflow. Theoretically it should not be necessary to call unlock when
    lock failed, but it's currently not possible to eliminate the unlock
    call.
    
    Add tests for global schema lock in combination with SELECT I_S.TABLES
    query using MAX_EXECUTION_TIME as well as DDL query being killed while
    waiting for global schema lock.
    
    Change-Id: If9e5c9787c347c400a66d2edf00cc59abe993419
Loading