Commit 727707ac authored by Luis Soares's avatar Luis Soares

BUG#40143 federated.federated_server fails sporadically in pushbuild

The original goal of the test, as reported on BUG #25721, is to check whether 
a deadlock happens or not when concurrently CREATING/ALTERING/DROPPING the 
same server. For that a procedure (p1) is created that runs the exact same 
CREATE/ALTER/DROP statements for 10K iterations and two different connections 
(threads - t1 and t2) call p1 concurrently. At the end of the 10K iterations, 
the test checks if there was errors while running the loop (SELECT e >0).
      
The problem is that In some cases it may happen that one thread, t1, gets 
scheduled to execute with just enough time to complete the iteration and 
never bumps into the other thread t2. Meaning that t1 will never run into an 
SQL exception. On the other hand, the other thread, t2, may run into t1 and 
never issue any/part of its own statements because it will throw an SQLEXCEPTION. 
This is probably the case for failures where only one value differs.
      
Furthermore, there is a third scenario: both threads are scheduled to run 
interleaved for each iteration (or even one thread completes all iterations 
before the other starts). In this case, both will succeed without any error. 
This is probably the case for the failure that reports two different values.
      
This patch addresses the failure in pushbuild by removing the error counting 
and the printout (SELECT > 0) at the end of the test. A timeout should occur 
if the error that the test is checking surfaces.
parent c2a4f390
......@@ -259,9 +259,8 @@ use test;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0;
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = sleep(5);
WHILE v < 10000 do
CREATE SERVER s
......@@ -271,15 +270,10 @@ ALTER SERVER s OPTIONS (USER 'Remote');
DROP SERVER s;
SET v = v + 1;
END WHILE;
SELECT e > 0;
END//
use test;
call p1();
call p1();
e > 0
1
e > 0
1
drop procedure p1;
drop server if exists s;
DROP TABLE IF EXISTS federated.t1;
......
......@@ -305,9 +305,8 @@ delimiter //;
create procedure p1 ()
begin
DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0;
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = sleep(5);
WHILE v < 10000 do
CREATE SERVER s
......@@ -317,7 +316,6 @@ begin
DROP SERVER s;
SET v = v + 1;
END WHILE;
SELECT e > 0;
END//
delimiter ;//
connection other;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment