[MDEV-13456] main.create_drop_event fails sporadically in buildbot Created: 2017-08-05  Updated: 2017-08-05  Resolved: 2017-08-05

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.1, 10.2
Fix Version/s: 10.1.26, 10.2.8

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Elena Stepanova
Resolution: Fixed Votes: 0
Labels: None


 Description   

http://buildbot.askmonty.org/buildbot/builders/winx64-packages/builds/4253/steps/test/logs/stdio

main.create_drop_event                   w2 [ fail ]
        Test ended at 2017-08-03 07:22:16
 
CURRENT_TEST: main.create_drop_event
--- D:/winx64-packages/build/src/mysql-test/r/create_drop_event.result	2017-08-03 05:45:17.000000000 +0000
+++ D:\winx64-packages\build\src\mysql-test\r\create_drop_event.reject	2017-08-03 07:22:15.316006100 +0000
@@ -31,7 +31,7 @@
 SET GLOBAL event_scheduler=on;
 SELECT DISTINCT a FROM t1;
 a
-13
+10
 SET GLOBAL event_scheduler=off;
 DELETE FROM t1;
 DROP EVENT IF EXISTS ev1;
 
mysqltest: Result content mismatch

All recorded failures happened on Windows, first time in January 2017 on bb-10.2-serg. There have been 6 occurrences since then on 10.2-based trees, and one occurrence on Aug 8th on 10.1 tree.



 Comments   
Comment by Elena Stepanova [ 2017-08-05 ]

The issue appears to be a simple race condition, on rare occasion execution of the event (the one that inserts 10 into the table takes too long, it outlives disabling event_scheduler, cleaning up the table and re-enabling event_scheduler again. An injected delay allows to reproduce it reliably:

diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index e02b618..7e0df5c 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -181,6 +181,8 @@ pre_init_event_thread(THD* thd)
   THD *orig_thd= current_thd;
   DBUG_ENTER("pre_init_event_thread");
 
+  my_sleep(1000000);
+
   set_current_thd(thd);
   thd->client_capabilities= 0;
   thd->security_ctx->master_access= 0;

Generated at Thu Feb 08 08:05:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.