Bug #46662 Ndb : mysqlbinlog fails to apply update to table with unique index

Submitted: 11 Aug 2009 21:39 Modified: 8 Oct 2009 17:00
Reporter: Andrew Hutchings Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S2 (Serious)
Version:mysql-5.1-telco-6.3 OS:Any
Assigned to: Frazer Clement CPU Architecture:Any
Tags: 6.3.20, 7.0.6

[11 Aug 2009 21:39] Andrew Hutchings
Description:
When using a specific table with a longtext column an update on a primary key appears to be corrupted in the binlog when viewed in mysqlbinlog and gives a duplicate primary key error when replayed in mysql.

How to repeat:
Tested in 6.3.20 and 7.0.6:

1. Start a basic cluster (1 ndbd node will do) with log-bin on
2. Import sql file
3. update LAS set LASname='testme' WHERE lasID=1;
4. drop table LAS
5. Try and re-insert the binary log

090810 21:34:50 [ERROR] Slave SQL: Could not execute Write_rows event on table test.LAS; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log FIRST, end_log_pos 3597, Error_code: 1062
 ERROR 1062 (23000) at line 139: Duplicate entry '1' for key 'PRIMARY'
 
 In the binary log:
 
 ### INSERT INTO mysql.ndb_apply_status 
 ### SET 
 ### @1=1 
 ### @2=1567663063057
 ### @3=''
 ### @4=0
 ### @5=0
 eHSAShcBAAAALwAAAA0OAAAQABEAAAAAAAEAFREAAPwBAAAACmlscHJlYXNyMDU=
 '/*!*/;
 ### INSERT INTO test.LAS
 ### SET
 ### @1=1762263040
 ### @5=NULL
 ### INSERT INTO test.LAS
 ### SET
 ### @1=1920164197
 ### @5='5\x18\x00\x00\x00Y\x00\x00\x00\x03\x03\x03\x0f\x0f\x03\x03\x03\x04\x0f\x04\x03\x03\x03\x0f\x0f\x03\x0f\x0f�\x10(11\x00\x00\x00\x00\x00\x00�\x00�\x00\x00\x00\x00\x00\x00'
[28 Aug 2009 12:18] Jonas Oreland
how do you do to reapply the binlog ?
[28 Aug 2009 15:37] Andrew Hutchings
By mysqlbinlog -D | mysql

Although I don't understand how that is relevant because the damage is already done at this point.
[15 Sep 2009 12:28] Frazer Clement
Issue with output of mysqlbinlog --verbose moved to separate bug : 
bug#47323 mysqlbinlog --verbose displays bad output when events contain subset of columns
[28 Sep 2009 18:11] Frazer Clement
Proposed fix + testcase against 6.2

Attachment: bug46662-strict-mode.patch (text/x-patch), 3.55 KiB.

[28 Sep 2009 18:13] Frazer Clement
Proposed patch is against 6.2.

Fix extends 'special handling' of Binlog WRITE_ROW events from slave thread to threads applying BINLOG events.

Testcase verifies scenario where update replicated as write is applied to table containing unique index.
[28 Sep 2009 18:19] Frazer Clement
Note that patch applies on top of proposed patches for :
 - bug#47323 mysqlbinlog --verbose displays bad output when events contain subset of columns
 - bug#47674 MySQL Cluster : Manually applying binlog zaps unmodified columns
[29 Sep 2009 16:08] Frazer Clement
Synopsis was "NDB Binary log corruption with longtext"

Apparent corruption was bug with mysqlbinlog --verbose output, corrected by bug#47323.

Failure to apply binlog was actually due to the unique index on the table the event was being applied to.

So Synopsis is changed to :
"Ndb : mysqlbinlog fails to apply update to table with unique index"
[6 Oct 2009 14:21] 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/85921

3013 Frazer Clement	2009-10-06
      Bug#46662 : Ndb : mysqlbinlog fails to apply update to table with unique index
      modified:
        mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
        mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster.h
[7 Oct 2009 13:39] 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/86015

3019 Frazer Clement	2009-10-07
      Bug#46662 : Ndb : mysqlbinlog fails to apply update to table with unique index
      modified:
        mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
        mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
        sql/ha_ndbcluster.cc
[7 Oct 2009 16:28] 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/86045

3020 Frazer Clement	2009-10-07
      Bug#46662 : Ndb : mysqlbinlog fails to apply update to table with unique index
      modified:
        mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
        mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
        sql/ha_ndbcluster.cc
[7 Oct 2009 17:59] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:frazer@mysql.com-20091007175700-8wd8ryjuod207m53) (version source revid:frazer@mysql.com-20091007175700-8wd8ryjuod207m53) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[7 Oct 2009 18:02] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:frazer@mysql.com-20091007171652-wu5bpgcq3ijt1ods) (version source revid:frazer@mysql.com-20091007171652-wu5bpgcq3ijt1ods) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[7 Oct 2009 18:02] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:frazer@mysql.com-20091007173823-ds7yw5xd652n28vm) (version source revid:frazer@mysql.com-20091007173823-ds7yw5xd652n28vm) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[7 Oct 2009 18:03] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:frazer@mysql.com-20091007162703-ryrg5b743sj1zft5) (version source revid:frazer@mysql.com-20091007162703-ryrg5b743sj1zft5) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[8 Oct 2009 15:39] Frazer Clement
Fix pushed to 
6.2.19
6.3.28
7.0.9
7.1.0
[8 Oct 2009 17:00] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.28, and 7.0.9 changelogs, as follows:

      mysqlbinlog failed to apply a binary log recorded using
      --log-update-as-write=1.

Closed.
[15 Oct 2009 15:45] 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/87008

3018 Martin Skold	2009-10-15 [merge]
      Merge
      modified:
        config/ac-macros/ha_ndbcluster.m4
        mysql-test/suite/ndb/my.cnf
        mysql-test/suite/ndb/r/ndb_config.result
        mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
        mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
        mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster.h
        storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp
        storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
        storage/ndb/include/kernel/signaldata/NodeFailRep.hpp
        storage/ndb/include/ndb_global.h.in
        storage/ndb/include/ndbapi/NdbDictionary.hpp
        storage/ndb/include/ndbapi/NdbOperation.hpp
        storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan.cpp
        storage/ndb/src/kernel/blocks/backup/Backup.cpp
        storage/ndb/src/kernel/blocks/backup/Backup.hpp
        storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
        storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
        storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
        storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
        storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
        storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp
        storage/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
        storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
        storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
        storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
        storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
        storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
        storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
        storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp
        storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
        storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
        storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
        storage/ndb/src/kernel/blocks/lgman.cpp
        storage/ndb/src/kernel/blocks/lgman.hpp
        storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
        storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
        storage/ndb/src/kernel/blocks/suma/Suma.cpp
        storage/ndb/src/kernel/blocks/suma/Suma.hpp
        storage/ndb/src/kernel/blocks/trix/Trix.hpp
        storage/ndb/src/kernel/blocks/tsman.cpp
        storage/ndb/src/kernel/blocks/tsman.hpp
        storage/ndb/src/kernel/vm/DLFifoList.hpp
        storage/ndb/src/kernel/vm/DLHashTable.hpp
        storage/ndb/src/kernel/vm/DLList.hpp
        storage/ndb/src/kernel/vm/DataBuffer.hpp
        storage/ndb/src/kernel/vm/SimulatedBlock.cpp
        storage/ndb/src/kernel/vm/SimulatedBlock.hpp
        storage/ndb/src/mgmapi/LocalConfig.cpp
        storage/ndb/src/mgmapi/Makefile.am
        storage/ndb/src/mgmsrv/ConfigInfo.cpp
        storage/ndb/src/ndbapi/NdbDictionary.cpp
        storage/ndb/src/ndbapi/NdbOperation.cpp
        storage/ndb/test/ndbapi/testNdbApi.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.086 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.