Skip to content
  • Jon Olav Hauglid's avatar
    b6c3c797
    Bug#16362832: DDL IN XA TRANSACTION RELEASES TRANSACTION LOCKS · b6c3c797
    Jon Olav Hauglid authored
                  WITHOUT ENDING TRANSACTION
    
    If statements causing implicit commit are executed with an XA
    transaction in ACTIVE state, "The command cannot be executed
    when global transaction is in the ACTIVE state" error is 
    reported. This error causes the implicit commit to fail (as it should).
    
    The problem was that if the implicit commit at the start of a
    statement execution failed, we also tried to commit at the end 
    of the statement. This commit would fail for the same reason.
    However for this commit we assumed that the transaction 
    was either successfully committed or rolled back and therefore
    released transactional metadata locks. 
    
    This meant that the objects accessed earlier in the XA transaction
    no longer were protected and could be e.g. dropped by other
    connections. This again could lead to assertions, valgrind warnings
    and various other problems when the XA transaction later tried
    to commit.
    
    This patch fixes the problem by aborting the statement if the
    implicit commit at the beginning of the statement execution fails.
    This means that the release of transactional locks at the end
    of execution of statements causing implicit commit, will be skipped.
    b6c3c797
    Bug#16362832: DDL IN XA TRANSACTION RELEASES TRANSACTION LOCKS
    Jon Olav Hauglid authored
                  WITHOUT ENDING TRANSACTION
    
    If statements causing implicit commit are executed with an XA
    transaction in ACTIVE state, "The command cannot be executed
    when global transaction is in the ACTIVE state" error is 
    reported. This error causes the implicit commit to fail (as it should).
    
    The problem was that if the implicit commit at the start of a
    statement execution failed, we also tried to commit at the end 
    of the statement. This commit would fail for the same reason.
    However for this commit we assumed that the transaction 
    was either successfully committed or rolled back and therefore
    released transactional metadata locks. 
    
    This meant that the objects accessed earlier in the XA transaction
    no longer were protected and could be e.g. dropped by other
    connections. This again could lead to assertions, valgrind warnings
    and various other problems when the XA transaction later tried
    to commit.
    
    This patch fixes the problem by aborting the statement if the
    implicit commit at the beginning of the statement execution fails.
    This means that the release of transactional locks at the end
    of execution of statements causing implicit commit, will be skipped.
Loading