Replication failure with auto-increment and on duplicate key update

Bug #95821 reported by Alan Tam
2
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Debian)
Fix Released
Unknown
mysql-dfsg-5.0 (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Copied from debian bug report with slight changes.

Hi,

I am recently upgrading one of the slaves of a master-slave replication
to feisty, for 2 reasons:

1. attempt to fix http://bugs.mysql.com/bug.php?id=20188 which claims to
be fixed since 5.0.24

2. rehearse the migration; since we can afford zero downtime, we
can only first migrate slave to new version, switch it to a master, and
then upgrade the original master with a reversed replication

Then I begin to be hit by http://bugs.mysql.com/bug.php?id=24432 .
To repeat the details in the 2 bug reports, the fix of 20188 has
introduced another bug which make any version newer than 5.0.24 give a
wrong auto_increment behavior (irrespective to replication). This
behavior is finally fixed by 24432 in the recent 5.0.38 version.
The wrong auto_increment behavior in its own is a bit mild (it skips
some usable auto_increment values) but it causes replication problems
with other master/slave without this bug.

This bug is serious because any of the master or the slave with version
between 5.0.24 and 5.0.36 inclusive will make replication fail, although
it will work if both master and slave are within this range of versions.
See the chart in the bug report for more details.

If feisty ships with an unpatched version of 5.0.32, then people will have
a hard time upgrading to feisty, and also upgrading to feisty+1 later.
Since the bug is only fixed in upstream in 5.0.38, which is very
unlikely to be uploaded to feisty, I propose to backport the patch.

Here is the patch: http://lists.mysql.com/commits/19547

Backporting the patch will be a bit tricky, since upstream has inserted
some code to detect version numbers to determine whether a certain
replication will fail or survive. If ubuntu make their 5.0.32-10ubuntu1
free of this bug, then the logic there has to be altered.

Maybe it is safe for us to drop the checking, but this may cause problem
if some people run a replication between ubuntu and another distro.

--
Regards,
Alan

Changed in mysql-dfsg-5.0:
status: Unknown → Unconfirmed
Martin Pitt (pitti)
Changed in mysql-dfsg-5.0:
assignee: nobody → pitti
importance: Undecided → High
status: Unconfirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

 mysql-dfsg-5.0 (5.0.37-0ubuntu1) feisty; urgency=low
 .
   * New upstream bugfix release.
     - Fixes replication failure with auto-increment and on duplicate key
       update, a regression introduced into 5.0.24. (LP: #95821)
   * debian/control: Set Ubuntu maintainer.
   * debian/rules: Change comments from 'Debian etch' to 'Ubuntu 7.04'.

Changed in mysql-dfsg-5.0:
status: In Progress → Fix Released
Revision history for this message
Alan Tam (at) wrote :

Excuse me, debian has always been pulling code from the Enterprise branch of the tree (5.0.<even>), so 5.0.37 being a version of the Community branch should not be here.
The bug is actually fixed only in the Enterprise branch since 5.0.38 (released a week ago). http://dev.mysql.com/doc/refman/5.0/en/releasenotes-es-5-0-38.html
Is there anything we need to do, say replace it with 5.0.38?

Revision history for this message
Martin Pitt (pitti) wrote :

Alam, excuse my ignorance (I am not really familiar with MySQL's business model), but I am unable to find a download of 5.0.38. Can you please point me to an URL? I tried

  http://dev.mysql.com/downloads/mysql/5.0.html
  http://downloads.mysql.com/archives.php?p=mysql-5.0
  http://downloads.mysql.com/snapshots.php
  http://downloads.mysql.com/snapshots.php?p=mysql-5.0

but they manage to hide their enterprise versions very well.

Thank you!

Revision history for this message
Alan Tam (at) wrote :

Martin,

They deliberately make it difficult to find the source for Enterprise versions!
I also heard that support contracts will terminate if their support customers redistribute the source code.
This doesn't seem like a GPL-violation though.

Here you are: ftp://ftp.mysql.com/pub/mysql/src/

Revision history for this message
Martin Pitt (pitti) wrote :

Alan, thanks a lot. I'll go ahead and package .38 now, and add this URL to the README.Maintainer.

Revision history for this message
Alan Tam (at) wrote :

I can verify that the bug is fixed in the new version.
BTW, do you think we can fix bug 34181 altogether?
I should be no more dangerous than uploading this untested new version.

Changed in mysql-dfsg-5.0:
status: Unconfirmed → Confirmed
Changed in mysql-dfsg-5.0 (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.