Bug #40926 rpl.rpl_truncate_falcon fails in Pushbuild due to wrong binlog-format being used
Submitted: 21 Nov 2008 15:30 Modified: 11 Dec 2008 14:27
Reporter: John Embretsen Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S7 (Test Cases)
Version:6.0.9-bzr OS:Any
Assigned to: John Embretsen CPU Architecture:Any
Tags: falcon, pushbuild, test failure

[21 Nov 2008 15:30] John Embretsen
Description:
The test rpl_truncate_falcon in the rpl test suite fails in Pushbuild (first edition) in certain special configurations.

Example:

COMMAND: SPAWN perl ./mysql-test-run.pl --tmpdir=/dev/shm/pbtmp-ps_row-102 --vardir=/dev/shm/var-ps_row-102 --timer --force --ps-protocol --mysqld=--binlog-format=row

(...)

rpl.rpl_truncate_3innodb 'stmt' [ pass ]           1128
rpl.rpl_truncate_falcon 'stmt' [ fail ]

=== SHOW MASTER STATUS ===
---- 1. ----
File	slave-bin.000001
Position	497
Binlog_Do_DB	
Binlog_Ignore_DB	
==========================

=== SHOW SLAVE STATUS ===
---- 1. ----
Slave_IO_State	Waiting for master to send event
Master_Host	127.0.0.1
Master_User	root
Master_Port	11020
Connect_Retry	1
Master_Log_File	master-bin.000001
Read_Master_Log_Pos	528
Relay_Log_File	slave-relay-bin.000003
Relay_Log_Pos	448
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	Yes
Slave_SQL_Running	No
Replicate_Do_DB	
Replicate_Ignore_DB	
Replicate_Do_Table	
Replicate_Ignore_Table	
Replicate_Wild_Do_Table	
Replicate_Wild_Ignore_Table	
Last_Errno	1598
Last_Error	Error 'Binary logging not possible. Message: Statement-based format required for this statement, but not allowed by this combination of engines' on opening tables
Skip_Counter	0
Exec_Master_Log_Pos	301
Relay_Log_Space	831
Until_Condition	None
Until_Log_File	
Until_Log_Pos	0
Master_SSL_Allowed	No
Master_SSL_CA_File	
Master_SSL_CA_Path	
Master_SSL_Cert	
Master_SSL_Cipher	
Master_SSL_Key	
Seconds_Behind_Master	
Master_SSL_Verify_Server_Cert	No
Last_IO_Errno	0
Last_IO_Error	
Last_SQL_Errno	1598
Last_SQL_Error	Error 'Binary logging not possible. Message: Statement-based format required for this statement, but not allowed by this combination of engines' on opening tables
=========================

mysqltest: In included file "./extra/rpl_tests/rpl_truncate_helper.test": At line 24: could not sync with master ('select master_pos_wait('master-bin.000001', 528)' returned NULL)

The result from queries just before the failure was:
< snip >
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
SET GLOBAL  BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b LONG) ENGINE=Falcon;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1;
a	b
1	1
2	2
**** On Slave ****

More results from queries before failure can be found in /dev/shm/var-ps_row-102/log/rpl_truncate_falcon.log

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

Test does:

--source include/have_binlog_format_row.inc

to make sure that the test is not run with binlog-format=stmt, but that does not seem to work in all cases (may be caused by previous test setting binlog-format explicitly).

How to repeat:
In mysql-6.0-falcon-team branch, do:

$ cd mysql-test/
$ ./mysql-test-run.pl --suite=rpl --mysqld=--binlog-format=row

Running the test by itself or with default binlog format does not result in test failure.

Suggested fix:
Not sure yet.
[21 Nov 2008 16: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/59573

2915 John H. Embretsen	2008-11-21
      Bug#40926, Bug#40927, Bug#40930: Disabling rpl falcon tests that fail in Pushbuild 
      until failures have been properly analyzed and possibly fixed.
      
      rpl.rpl_extraCol_falcon: Fails on Windows in Pushbuild 2 during STOP SLAVE (bug 40930).
      rpl.rpl_relay_space_falcon: Fails in Pushbuild due to binlog-format settings (bug 40927).
      rpl.rpl_truncate_falcon: Fails in Pushbuild due to binlog-format settings (bug 40926).
[27 Nov 2008 16:36] John Embretsen
Test failed in this configuration due to the sourced helper script (mysql-test/extra/rpl_tests/rpl_truncate_helper.test) setting the variable BINLOG_FORMAT without resetting it at the end of the test. This practically 'disabled' the check for correct binlog-format (row) in rpl_truncate_falcon, and made the test run with binlog-format 'statement' on the slave server.

There may be a 'deeper' issue at play here (wrt. test configurations and option precedence in relation to replication tests), but adding variable cleanup to the helper script is in any case a healthy change that seems to make the test (and rpl suite) pass in the configurations used in Pushbuild.

See also Bug#38350 "Many tests don't clean up after themselves on exit".

My intention is to provide a cleanup patch for this in the mysql-6.0-falcon-team branch, because related fixes that are in the mysql-6.0-rpl branch may take a while to make their way into 6.0 main.
[27 Nov 2008 17:42] 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/60095

2921 John H. Embretsen	2008-11-27
      Fix for Bug#40926 - rpl.rpl_truncate_falcon fails in Pushbuild due to wrong binlog-format being used.
      
      Related to bug 40927 and bug 38350. Test failed due to BINLOG_FORMAT variable being set in sourced helper script.
      Making the helper script (rpl_truncate_helper.test) clean up after itself seems to resolve this issue.
      Adjusting affected result files for all three storage engines (falcon, innodb, myisam).
[1 Dec 2008 8:12] John Embretsen
Patch pushed to mysql-6.0-falcon-team bzr branch.
Date: 2008-11-28 13:56:05 UTC 
Revision: john.embretsen@sun.com-20081127173934-r8fxrt1pytgya6w7
[11 Dec 2008 14:20] Bugs System
Pushed into 6.0.9-alpha  (revid:john.embretsen@sun.com-20081127173934-r8fxrt1pytgya6w7) (version source revid:hky@sun.com-20081205164847-vbocpvlyf6fbxkkj) (pib:5)
[11 Dec 2008 14:27] Paul DuBois
Test case changes. No changelog entry needed.