Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38292

If GTT is in use in a replica session, DROP TABLE isn't applied.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 12.3
    • Replication
    • None
    • Q4/2025 Server Development

    Description

      When we drop a GTT table (in ON COMMIT PRESERVE ROWS mode) on primary and while the table is in use in a replica session, the replica session sees a Deadlock on the GTT. But if we close the replica session the deadlock is gone and the DROP TABLE gets executed successfully.

      MTR Test

      -- source include/master-slave.inc
      -- source include/have_binlog_format_row.inc
       
      --connect (m1,127.0.0.1,root,,,$SERVER_MYPORT_1)
      CREATE GLOBAL TEMPORARY TABLE  gtt(i int, t text) ON COMMIT PRESERVE ROWS;
      INSERT INTO gtt VALUES (1, 'from master');
      --disconnect m1
       
      --connect (s1,127.0.0.1,root,,,$SERVER_MYPORT_2)
      INSERT INTO gtt VALUES (2, 'from slave');
       
      --connect (m2,127.0.0.1,root,,,$SERVER_MYPORT_1)
      DROP TABLE gtt;
       
      --connection s1
      SHOW TABLES;
      query_vertical SHOW SLAVE STATUS;
      --error ER_LOCK_DEADLOCK
      SELECT * FROM gtt;
      --disconnect s1
       
      --connect (s2,127.0.0.1,root,,,$SERVER_MYPORT_2)
      SHOW TABLES;
      query_vertical SHOW SLAVE STATUS;
      --error ER_NO_SUCH_TABLE
      SELECT * FROM gtt;
      

      Note:
      In ON COMMIT DELETE ROWS mode the DROP TABLE is applied on the replica successfully without any error.

      Expected behavior:
      ON COMMIT PRESERVE ROWS mode shouldn't see any deadlock error.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              susil.behera Susil Behera
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.