Comment 12 for bug 1002714

Henrik Ingo (hingo) wrote :

Ok, with the lock timeouts lowered it kinda works, at least better:

Database connection established
Error when executing SQL statement: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
Database connection terminated
Database connection established
Error when executing SQL statement: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
Database connection terminated
Database connection established
Error when executing SQL statement: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
Database connection terminated
Database connection established
Error when executing SQL statement: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
Database connection terminated
Database connection established
Error when executing SQL statement: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

Until the timeout triggers, show processlist is as usual:

| 18 | system user | | NULL | Sleep | 478 | NULL | NULL | 0 | 0 | 1 |
| 26 | root | esitbi128lab.ntc.nokia.com:58301 | test | Query | 10 | Waiting for global read lock | INSERT INTO jdbctests (t, h, d) VALUES ('Inserted from Java code.', @@hostname, now()) | 0 | 0 | 1 |
| 27 | root | localhost | NULL | Query | 0 | NULL | show processlist | 0 | 0 | 1 |

Returning Unknown error will still be a big improvement since it is a) immediate and b) handled better by the jdbc driver. At least I think b is true - I never saw an Unknown error propagate back to the output, it may be that it silently reconnects and retries such transactions. (If it is the first query in a transaction, of course.)

Anyway, these timeouts would probably work for mysqldump too and seem to be a "better than nothing" solution if anyone needs it. (I doubt in practice anyone will use mysqldump if they are also using state of the art load balancing :-)