Bug #50650 Limited usability of NDB$MAX, here comes NDB$MAX_DELETE_WIN
Submitted: 27 Jan 2010 9:27 Modified: 27 Jan 2010 12:13
Reporter: Jonas Oreland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.3 OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any

[27 Jan 2010 9:27] Jonas Oreland
Description:
Using the NDB$MAX resolution strategy for cluster conflict resolution,
a delete is infact processed as NDB$OLD (as no timestamp is available on the
delete). For some usecases, this is not optimal.

Therefor a slight twist of NDB$MAX is introduced called NDB$MAX_DELETE_WIN, which instead makes the delete always win.

How to repeat:
.

Suggested fix:
.
[27 Jan 2010 9:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/98292

3092 Jonas Oreland	2010-01-27
      ndb - bug#50650 - introduce NDB$MAX_DELETE_WIN
[27 Jan 2010 9:54] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20100127092910-enfg3r1ht7omoes0) (version source revid:jonas@mysql.com-20100127092910-enfg3r1ht7omoes0) (merge vers: 5.1.41-ndb-6.3.31) (pib:16)
[27 Jan 2010 9:54] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20100127095254-8ouksyj2vyeo3xtr) (version source revid:jonas@mysql.com-20100127095254-8ouksyj2vyeo3xtr) (merge vers: 5.1.41-ndb-7.0.11) (pib:16)
[27 Jan 2010 12:12] Jon Stephens
Documented feature addition in the NDB-6.3.31 and 7.0.11 changelogs as follows:

        Due to the fact that no timestamp is available for delete
        operations, a delete using NDB$MAX() is actually processed as 
        NDB$OLD. However, because this is not optimal for some use 
        cases, NDB$MAX_DELETE_WIN() is added as a conflict resolution 
        function; if the so-called "timestamp" column value for a given 
        row adding or updating an existing row coming from the master 
        is higher than that on the slave, it is applied (as with 
        NDB$MAX()); however, delete operations are treated as always 
        having the higher value.
        
        See http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-conflict-resolution.html
        for more information.

Also updated mysql-cluster-replication-conflict-resolution section of Manual.
[27 Jan 2010 12:13] Jon Stephens
Status should be Closed, not NDI.