Skip to content
  • Gopal Shankar's avatar
    a2e09bfd
    Bug#26770836 SLAVE HANGS - WAITING FOR TABLE METADATA LOCKS · a2e09bfd
    Gopal Shankar authored
    A DDL on table would trigger change in view metadata update.
    We acquire MDL locks on view and the dependent tables during
    this process. We release these acquired locks just after
    finishing the view metadata update, and we do not hold the
    MDL lock until the statement is committed.
    
    An expectation from binary log subsystem is that it assumes
    all MDL acquired by the statement are held till commit
    phase, so two statements acquiring conflicting sets of locks
    can't be committed at the same time. This assumption is
    broken by release-before-commit optimization done during
    view metadata update.
    
    This patch enables MDL locks acquired during view metadata
    update to be held until commit. A test case is added to make
    sure we acquire lock after view metadata is updated. The test
    case for Bug#25685371 is removed as we no more release locks
    at the end of view metadata update, and the problem reported
    there cannot occur.
    
    Change-Id: I3757428fc01788b9314a961b5fd2f83830811485
    a2e09bfd
    Bug#26770836 SLAVE HANGS - WAITING FOR TABLE METADATA LOCKS
    Gopal Shankar authored
    A DDL on table would trigger change in view metadata update.
    We acquire MDL locks on view and the dependent tables during
    this process. We release these acquired locks just after
    finishing the view metadata update, and we do not hold the
    MDL lock until the statement is committed.
    
    An expectation from binary log subsystem is that it assumes
    all MDL acquired by the statement are held till commit
    phase, so two statements acquiring conflicting sets of locks
    can't be committed at the same time. This assumption is
    broken by release-before-commit optimization done during
    view metadata update.
    
    This patch enables MDL locks acquired during view metadata
    update to be held until commit. A test case is added to make
    sure we acquire lock after view metadata is updated. The test
    case for Bug#25685371 is removed as we no more release locks
    at the end of view metadata update, and the problem reported
    there cannot occur.
    
    Change-Id: I3757428fc01788b9314a961b5fd2f83830811485
Loading