[MXS-1047] Batch inserts through Maxscale with C/J stall Created: 2016-12-06  Updated: 2016-12-09  Resolved: 2016-12-08

Status: Closed
Project: MariaDB MaxScale
Component/s: Core, mariadbbackend, readwritesplit
Affects Version/s: 2.0.2
Fix Version/s: 2.0.3, 2.1.0

Type: Bug Priority: Major
Reporter: Kyle Joiner (Inactive) Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Test case:

public class BatchInsert {
 
    static final String ADDRESS = "127.0.0.1";
    static final String PORT = "4006";
    static final String USER = "maxuser";
    static final String PASSWORD = "maxpwd";
    static final String DB = "test";
 
    public static void main(String[] args) {
        try (Connection connection = DriverManager.getConnection("jdbc:mariadb://"
                + ADDRESS + ":" + PORT + "/" + DB + "?user=" + USER + "&password="
                + PASSWORD + "&useBatchMultiSendNumber=500")) {
            Statement stmt = connection.createStatement();
            stmt.execute("DROP TABLE IF EXISTS tt");
            stmt.execute("CREATE TABLE tt (d int)ENGINE=BLACKHOLE");
            for (int i = 0; i < 300; i++) {
                stmt.addBatch("INSERT INTO tt(d) VALUES (1)");
                if (i % 3 == 0) {
                    stmt.addBatch("SET @test2='aaa'");
                }
            }
            stmt.executeBatch();
            System.out.println("finished");
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}



 Comments   
Comment by markus makela [ 2016-12-08 ]

The backend protocol module discarded extra data after a response to session command was received. The router also didn't write data to the master if it was already executing something.

Generated at Thu Feb 08 04:03:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.