summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/mdev-15707.test
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-04-05 13:17:17 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2018-04-08 21:32:02 +0000
commit7b16291c3693e2e15d79e3150b8b72c81a636257 (patch)
treeee1f7dd3fc8ae10a32d2013632ed8db2844faf77 /mysql-test/suite/innodb/t/mdev-15707.test
parentb4c2ceb214c262c09094fd3d318c786368259760 (diff)
downloadmariadb-git-7b16291c3693e2e15d79e3150b8b72c81a636257.tar.gz
MDEV-15707 : deadlock in Innodb IO code, caused by change buffering.
In async IO completion code, after reading a page,Innodb can wait for completion of other bufferpool reads. This is for example what happens if change-buffering is active. Innodb on Windows could deadlock, as it did not have dedicated threads for processing change buffer asynchronous reads. The fix for that is to have windows now has the same background threads, including dedicated thread for ibuf, and log AIOs. The ibuf/read completions are now dispatched to their threads with PostQueuedCompletionStatus(), the write and log completions are processed in thread where they arrive.
Diffstat (limited to 'mysql-test/suite/innodb/t/mdev-15707.test')
-rw-r--r--mysql-test/suite/innodb/t/mdev-15707.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/mdev-15707.test b/mysql-test/suite/innodb/t/mdev-15707.test
new file mode 100644
index 00000000000..46e1ee7ce57
--- /dev/null
+++ b/mysql-test/suite/innodb/t/mdev-15707.test
@@ -0,0 +1,28 @@
+--source include/windows.inc
+
+# Deadlock in conjunction with the innodb change buffering.
+
+# When innodb change buffering kicks in, i.e secondary non-unique index
+# does not fit into the bufferpool, then, on Windows, innodb
+# background threads could deadlock whenever index page is
+# read, and the page needs load/merge change buffer.
+# The test tries to reproduce this situation, by creating index
+# that does not fit into bufferpool, and doing a large update.
+
+CREATE TABLE t1(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(255),
+INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO t1(b) SELECT UUID();
+BEGIN;
+let $i=`select cast(log2(@@innodb_buffer_pool_size/255) as int)`;
+while ($i)
+{
+ INSERT INTO t1(b) SELECT UUID() FROM t1;
+ dec $i;
+}
+COMMIT;
+UPDATE t1 SET b=UUID();
+DROP TABLE t1; \ No newline at end of file