From: Ole John Aske Date: September 24 2012 2:12pm Subject: bzr push into mysql-5.5-cluster-7.2 branch (ole.john.aske:4008 to 4009) List-Archive: http://lists.mysql.com/commits/144892 Message-Id: <20120924141208.22620.7861.4009@fimafeng09.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4009 Ole John Aske 2012-09-24 Fixed possible deadlock / timeout in ndb_spj_dict.test: This test has two parallel server connection: 1) Started a (pushed) join possibly creating a lot of result rows 2) Do some alter table DDLs which is expected to terminate query in 1) However, as 1) created a lots of result, which is sent through the client-server interface with a TCP 'write()', the TCP send/recv buffers may fill up. If these buffers became completely filled before the query was killed by the the DDL, we seems to enter a deadlock state where neither the DDL is able to execute, and no further communication can take place. Thus, the MTR test timed out with 'Lost connection to the MySQL server'. This fix change to using a 'select count(*)' instead of a plain 'select *' in order to avoid saturated TCP buffers. modified: mysql-test/suite/ndb/r/ndb_spj_dict.result mysql-test/suite/ndb/t/ndb_spj_dict.test 4008 Mauritz Sundell 2012-09-21 [merge] merge 7.1->7.2, no changes === modified file 'mysql-test/suite/ndb/r/ndb_spj_dict.result' --- a/mysql-test/suite/ndb/r/ndb_spj_dict.result 2012-09-19 12:49:56 +0000 +++ b/mysql-test/suite/ndb/r/ndb_spj_dict.result 2012-09-24 14:11:36 +0000 @@ -22,31 +22,10 @@ show variables like 'server_id'; Variable_name Value server_id 1 set ndb_join_pushdown = true; -explain select straight_join * -from parent join child -on child.a = parent.a and child.b = parent.b -where parent.b > 5; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE parent range PRIMARY,b b 4 NULL ### Parent of 2 pushed join@1; Using where with pushed condition -1 SIMPLE child eq_ref PRIMARY,b PRIMARY 8 test.parent.a,test.parent.b ### Child of 'parent' in pushed join@1 -explain select straight_join * -from parent join child -on child.a = parent.a -where parent.b > 5; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE parent range PRIMARY,b b 4 NULL ### Parent of 2 pushed join@1; Using where with pushed condition -1 SIMPLE child ref PRIMARY PRIMARY 4 test.parent.a ### Child of 'parent' in pushed join@1 -explain select straight_join * -from parent join child -on child.b = parent.a -where parent.b > 5; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE parent range PRIMARY,b b 4 NULL ### Parent of 2 pushed join@1; Using where with pushed condition -1 SIMPLE child ref b b 4 test.parent.a ### Child of 'parent' in pushed join@1 ============================================ Early 'online' drop of REF'ed child's KEY b. ============================================ -explain select straight_join * +explain select straight_join count(*) from parent join child on child.b = parent.a where parent.b > 5; @@ -59,7 +38,7 @@ alter table child add key(b); ============================================ Late 'online' drop of REF'ed child's KEY b. ============================================ -explain select straight_join * +explain select straight_join count(*) from parent join child on child.b = parent.a where parent.b > 5; @@ -72,7 +51,7 @@ alter table child add key(b); ============================================ Early drop of EQ_REF'ed child's PRIMARY KEY. ============================================ -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -85,7 +64,7 @@ alter table child add primary key(a,b); ============================================================= Drop of EQ_REF'ed child's PRIMARY KEY after executed a while. ============================================================= -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -98,7 +77,7 @@ alter table child add primary key(a,b); =========================================================== ONLINE ALTER: Rename table to make it go away - temporarily =========================================================== -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -111,7 +90,7 @@ alter table child_orig rename to child; ======================================*===================== OFFLINE ALTER: Rename table to make it go away - temporarily ==========================================*================= -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -124,7 +103,7 @@ alter table child_orig rename to child; ================================================================= ONLINE ALTER: drop + recreate table 'child' key b in use by query ================================================================= -explain select straight_join * +explain select straight_join count(*) from parent join child on child.b = parent.a where parent.b > 5; @@ -136,7 +115,7 @@ alter table child add key(b); ================================================================== ONLINE ALTER: drop + recreate table 'parent' key b in use by query ================================================================== -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -148,7 +127,7 @@ alter table parent add key(b); =============================================== OFFLINE ALTER: add + drop column c from 'child' =============================================== -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -160,7 +139,7 @@ alter table child drop column c; ========================================================== OFFLINE ALTER: drop + recreate primary key(a,b) for 'child' ========================================================== -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a where parent.b > 5; @@ -172,7 +151,7 @@ alter table child add primary key(a,b); ================== DROP TABLE 'child' ================== -explain select straight_join * +explain select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; @@ -184,6 +163,3 @@ drop table child; Cleaning up =========== drop table if exists parent; -drop table if exists child; -Warnings: -Note 1051 Unknown table 'child' === modified file 'mysql-test/suite/ndb/t/ndb_spj_dict.test' --- a/mysql-test/suite/ndb/t/ndb_spj_dict.test 2012-09-19 12:49:56 +0000 +++ b/mysql-test/suite/ndb/t/ndb_spj_dict.test 2012-09-24 14:11:36 +0000 @@ -64,33 +64,25 @@ connection server1; show variables like 'server_id'; let $query1 = - select straight_join * + select straight_join count(*) from parent join child on child.a = parent.a and child.b = parent.b where parent.b > 5; let $query2 = - select straight_join * + select straight_join count(*) from parent join child on child.a = parent.a where parent.b > 5; let $query3 = - select straight_join * + select straight_join count(*) from parent join child on child.b = parent.a where parent.b > 5; set ndb_join_pushdown = true; ---replace_column 9 ### -eval explain $query1; - ---replace_column 9 ### -eval explain $query2; - ---replace_column 9 ### -eval explain $query3; # This test provokes failure to lock metadata connection server1; @@ -354,5 +346,4 @@ reap; connection ddl; drop table if exists parent; -drop table if exists child; No bundle (reason: useless for push emails).