I am trying to update from 4.0 to 4.5.1 but the process always fails at UpdateMeasuresDebtToMinutes
. I am using MySQL 5.5.27 as a database with InnoDB as table engine.
Basically the problem looks like this problem
After the writeTimeout exceeds (600 seconds) there is an exception in the log
Caused by: java.io.EOFException: Can not read response from server. Expected to read 81 bytes, read 15 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3166) ~[mysql-connector-java-5.1.27.jar:na]
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3676) ~[mysql-connector-java-5.1.27.jar:na]
Adding the indexes as proposed in the linked issue did not help.
Investigating further I noticed several things:
- the migration step reads data from a table and wants to write back to the same table (
project_measures
) - project_measures contains more than 770000 rows
- the process always hangs after 249 rows
- the hanging happens in
org.sonar.server.migrations.MassUpdate
when callingupdate.addBatch()
which after theBatchSession.MAX_BATCH_SIZE (250)
forces an execute and a commit
is there a way to configure the DB connection to allow this to proceed?