################################################################## # Test intended for provoking issues related to large transactions. # Includes, but not limited to: # - 'Job buffer full' due to commit/abort not limiting number of # outstanding signals. # - 'struck in thread', 'oversleept' and 'sleeploop 10!' due to # handling of many locks not scaling well. # ################################################################## --source include/have_ndb.inc create table t1 (a int primary key) engine=ndb; create table t2 (a int primary key) engine=ndb; delimiter %; # Insert batches of 32 rows, just to speed up test create procedure do_insert(count int) begin set @x = 0; repeat insert into t1 values (@x+0), (@x+1), (@x+2), (@x+3), (@x+4), (@x+5), (@x+6), (@x+7), (@x+8), (@x+9), (@x+10), (@x+11), (@x+12), (@x+13), (@x+14), (@x+15), (@x+16), (@x+17), (@x+18), (@x+19), (@x+20), (@x+21), (@x+22), (@x+23), (@x+24), (@x+25), (@x+26), (@x+27), (@x+28), (@x+29), (@x+30), (@x+31); set @x = @x + 32; until @x >= count end repeat; end % delimiter ;% # Generate large transactions, abort or commit them: begin; call do_insert(500000); rollback; begin; call do_insert(500000); commit; begin; insert into t2 select * from t1; rollback; begin; insert into t2 select * from t1; commit; begin; delete from t2; commit; begin; delete from t1; commit; drop procedure do_insert; drop table t1,t2; --echo ############################## --echo # --echo # Bug#34189965 --echo # DbAcc Validate(WITH_DEBUG) of Unique Key locks has --echo # exponential overhead. --echo # --echo # In order to guarante read consistency when using an unique index, --echo # shared read locks are set (and held) on the rows. When e.g. a --echo # join query join in the *same* row multiple times, each access --echo # results in additional locks being set. Such locks are all added --echo # to the same 'parallel queue' the the ACC block, which can end up --echo # with thousands of locks in the same parallel queue. --echo # --echo # When debug compiled, ACC validates the consistency of the queues, --echo # iterating the entire queue. The overhead of that may become so --echo # huge that the block thread scheduler starts complaining about --echo # being 'struck in thread', 'oversleept' and 'sleeploop 10!' create table t ( pk int primary key, uq int, i int, unique key (uq), key(i) ) engine = ndbcluster; create table t100000 ( i int ) engine = ndbcluster; insert into t values (0,0,1), (1,1,1), (2,2,1), (3,3,1), (4,4,1), (5,5,1), (6,6,1), (7,7,1), (8,8,1), (9,9,1); # Fill with 100K rows insert into t100000 select t1.i from t as t1 straight_join t as t2 on t2.i=t1.i straight_join t as t3 on t3.i=t2.i straight_join t as t4 on t4.i=t3.i straight_join t as t5 on t5.i=t4.i; # join-pushdown do not set locks, turn it off set ndb_join_pushdown=off; # Will look up the same table t row 100k times. # Note that BKA join hint is just to speed up test case select /*+ BKA(t) */ count(*) from t100000 as t1 straight_join t on t.uq=t1.i; set ndb_join_pushdown=default; drop table t; drop table t100000;