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

Wrong results sent to client after BF abort

    XMLWordPrintable

Details

    • Unexpected results
    • Q3/2026 Replic. Maintenance

    Description

      This issue is regression caused by MDEV-38019 Send ok packet to client earlier.

      BF aborts may be detected very late in command exectution, somewhere near the end of do_command(). If the ok packet has already been sent and BF abort is detected very late, this could cause the protocol packets becoming out of sync.

      This is a result of reverting order of releasing MDL and sending ok packet to the client. If it happens in the opposite order than before, there will remain some time window where the select is complete and MDL locks still held. DROPhits that time window, causing a BF abort, and extra error packet gets injected into client-server communication stream.

      e.g https://es-jenkins.mariadb.net/job/Test-Package//731849/artifact/test-MTR-custom.log/*view* test case galera_sr.mysql-wsrep-features#8

      galera_sr.mysql-wsrep-features#8         w1 [ fail ]
              Test ended at 2026-05-17 03:01:58
       
      CURRENT_TEST: galera_sr.mysql-wsrep-features#8
      --- /home/jenkins/workspace/Test-Package/mariadb-test/suite/galera_sr/r/mysql-wsrep-features#8.result	2026-05-17 01:51:30.000000000 +0000
      +++ /home/jenkins/workspace/Test-Package/mariadb-test/suite/galera_sr/r/mysql-wsrep-features#8.reject	2026-05-17 03:01:48.722817206 +0000
      @@ -23,16 +23,18 @@
       DROP TABLE t1;
       connection node_1;
       CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB;
      +COUNT(*) = 0
      +1
       connection node_2;
       INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
       connection node_1;
       SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz');
      -EXPECT_1000
      -1000
      +COUNT(*) = 1000
      +1
       UPDATE t1 SET f1 = 'abcdefjhk';
      -SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
       EXPECT_1000
       1000
      +SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
       connection node_2;
       SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');
       EXPECT_1000
       
      Result length mismatch
      

      Attachments

        Activity

          People

            janlindstrom Jan Lindström
            janlindstrom Jan Lindström
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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