Bug #131 --max-delayed-threads seems to have no effect
Submitted: 7 Mar 2003 4:15 Modified: 12 Apr 2003 1:36
Reporter: Jani Tolonen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0 (maybe others?) OS:Linux (Linux (others ?))
Assigned to: Jani Tolonen CPU Architecture:Any

[7 Mar 2003 4:16] Jani Tolonen
Setting --max-delayed-threads to 1 doesn't prevent more than
one insert delayed thread handler from invoking:

(rhols221:/my/bk/mysql-4.0) ./sql/mysqld --delayed_queue_size=1 --max-delayed-threads=1&
[1] 28752
(rhols221:/my/bk/mysql-4.0) 030307  9:58:42  InnoDB: Started
./sql/mysqld: ready for connections

(rhols221:~) mysqladmin var|grep -e delayed_q -e max_d|sed s/" "//g;
|delayed_queue_size|1|
|max_delayed_threads|1|

(rhols221:/my/bk/mysql-4.0) mysql test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.0.11-gamma-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table t1 (i int);
Query OK, 0 rows affected (0.00 sec)

mysql> create table t2 (i int);

mysql> lock tables t1 write, t2 write;
Query OK, 0 rows affected (0.00 sec)

mysql>

Then, in another window, leaving above as it is:
------------------------------------------------

(rhols221:~) mysql test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 4.0.11-gamma-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> insert delayed into t1 values (1);
Query OK, 1 row affected (0.00 sec)

mysql>

Then, in third window, leaving above as are:
--------------------------------------------

(rhols221:~) mysql test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.0.11-gamma-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> insert delayed into t1 values (2);

This one locks up. It's waiting for the first insert delay
to relief it, because max rows for insert delay was set to 1.

Then, in fourth window, leaving all above as are:
-------------------------------------------------

(rhols221:~) mysql test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.0.11-gamma-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> insert delayed into t2 values(1);
Query OK, 1 row affected (0.00 sec)

mysql>

This should have been converted to regular INSERT, but obviously
it went as INSERT DELAYED. Let's see in a window how mysqladmin
extended looks:

(rhols221:~) mysqladmin ex|grep Dela
| Delayed_insert_threads         | 2     |
| Delayed_writes                 | 0     |
| Delayed_errors                 | 0     |

Delayed_insert_threads comes 2, even when:

(rhols221:~) mysqladmin var|grep -e delayed_q -e max_d|sed s/" "//g;
|delayed_queue_size|1|
|max_delayed_threads|1|
[7 Apr 2003 22:32] Jani Tolonen
Fixed in MySQL 4.0
Regards,
Jani