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

MariaDB 10.2.22 is writing duplicate entries into binary log

Details

    Description

      We have a Master/Master Setup on two servers, but are only writing to one of those servers (so it is essentially Master/Slave)

      We upgraded from 10.1.* to 10.2.22 last week and starting with the upgrade, we are getting duplicate key errors on the slave.

      BINLOG=mixed

      Examing the binary log on the master and the relay log on the slave, we see:

      • BEGIN

      Then one binary blob:

      • INSERT table1 (id 1)
      • INSERT table2 (this one is triggered by the insert in table1)
      • INSERT table3 (id 4711)

      And then in Statement format:

      • INSERT table3 (id 4711)
      • COMMIT

      Which fails since it repeats the last statement of the binary blob.

      If I replay it by hand and leave out the statement block, everything is ok.

      I have found others to have the same problem. They found this bug starting with 10.2.10 (but it can also be earlier). One example is https://stackoverflow.com/questions/47650166/mariadb-10-2-10-writing-double-binlog-entries-in-mixed-format

      What adds to the strangeness: Only 1 in 100 inserts triggers this behavior and it only seems to be triggered on clients that access the master from outside the network (additionally, this client has MariaDB client libs from 10.1.*). So maybe it is a timing issue?

      Attachments

        Activity

          sujatha.sivakumar Sujatha Sivakumar (Inactive) added a comment - Hello Andrei, Good morning. Can you please review the fix for MDEV-19158 . The patch is available at https://github.com/MariaDB/server/commit/e28c2408c7447e70d9509c9078f1b93a7cda6078 http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.2-sujatha
          Elkin Andrei Elkin added a comment -

          Sujatha, well done, thanks for a nice work!

          Andrei

          Elkin Andrei Elkin added a comment - Sujatha, well done, thanks for a nice work! Andrei

          Fix for this issue is pushed in 10.2.25.

          10.3 merge will have a minor conflict in sql/handler.h:

          Please find the 10.3 patch

          https://github.com/MariaDB/server/commit/86a6a3b8faddc5f8ff1898c5b9a6727f9b584be0

          sujatha.sivakumar Sujatha Sivakumar (Inactive) added a comment - Fix for this issue is pushed in 10.2.25. 10.3 merge will have a minor conflict in sql/handler.h: Please find the 10.3 patch https://github.com/MariaDB/server/commit/86a6a3b8faddc5f8ff1898c5b9a6727f9b584be0
          dragle Daniel Ragle added a comment -

          This is listed as being fixed in 10.3.15; however I just updated to that version and I'm still seeing the same behavior from my test script above.

          Also, I suspect https://jira.mariadb.org/browse/MDEV-18437 should be linked to this one, as I believe they're the same issue.

          dragle Daniel Ragle added a comment - This is listed as being fixed in 10.3.15; however I just updated to that version and I'm still seeing the same behavior from my test script above. Also, I suspect https://jira.mariadb.org/browse/MDEV-18437 should be linked to this one, as I believe they're the same issue.

          Hello Daniel,

          Thank you for checking the 10.3.15 release. You are right, the fix missed the 10.3.15 release.
          Sorry for that. The fix will be included in next upcoming 10.3 release which is 10.3.16.
          I have updated the same in JIRA.

          Marked MDEV-18437 as duplicate for this issue.

          sujatha.sivakumar Sujatha Sivakumar (Inactive) added a comment - Hello Daniel, Thank you for checking the 10.3.15 release. You are right, the fix missed the 10.3.15 release. Sorry for that. The fix will be included in next upcoming 10.3 release which is 10.3.16. I have updated the same in JIRA. Marked MDEV-18437 as duplicate for this issue.

          People

            sujatha.sivakumar Sujatha Sivakumar (Inactive)
            kilroy kilroy
            Votes:
            1 Vote for this issue
            Watchers:
            5 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.