[jira] [Commented] (IGNITE-19247) BatchUpdateException: Replication is timed out" upon inserting rows in batches via JDBC
[ https://issues.apache.org/jira/browse/IGNITE-19247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17723215#comment-17723215 ] Igor commented on IGNITE-19247: --- [~xtern] there is no such words in logs. Full bug description and logs are here https://issues.apache.org/jira/browse/IGNITE-19488 > BatchUpdateException: Replication is timed out" upon inserting rows in > batches via JDBC > --- > > Key: IGNITE-19247 > URL: https://issues.apache.org/jira/browse/IGNITE-19247 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 3.0 >Reporter: Alexander Belyak >Assignee: Pavel Pereslegin >Priority: Critical > Labels: ignite-3 > Fix For: 3.0 > > Attachments: ReplicationTimeoutReproducerClientLog.zip, > node_0.log.zip, node_1.log.zip, serverLog.zip, test.log > > > Start single node cluster: > {noformat} > git commit 78946d4c > https://github.com/apache/ignite-3.git branch mainbuild by: > ./gradlew clean allDistZip -x test -x integrationTest -x check -x > modernizer > start by: > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ export > IGNITE_HOME=$(pwd) > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ bin/ignite3db start > Starting Ignite 3... > Node named defaultNode started successfully. REST addresses are > [http://127.0.1.1:10300] > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-cli-3.0.0-SNAPSHOT$ bin/ignite3 > cluster init --cluster-endpoint-url=http://localhost:10300 --cluster-name=c1 > --meta-storage-node=defaultNode > Cluster was initialized successfully{noformat} > Code below just create tables with columns (int key and > varchar cols) and insert rows into each table (with SLEEP ms interval > between operations, with attemps. > > {noformat} > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > public class TimeoutExceptionReproducer { > private static final String DB_URL = "jdbc:ignite:thin://127.0.0.1:10800"; > private static final int COLUMNS = 10; > private static final String TABLE_NAME = "K"; > private static final int ROWS = 10; > private static final int TABLES = 3; > private static final int BATCH_SIZE = 100; > private static final int SLEEP = 0; > private static final int RETRY = 1; > private static String getCreateSql(String tableName) { > StringBuilder sql = new StringBuilder("create table > ").append(tableName).append(" (id int primary key"); > for (int i = 0; i < COLUMNS; i++) { > sql.append(", col").append(i).append(" varchar NOT NULL"); > } > sql.append(")"); > return sql.toString(); > } > private static final void s() { > if (SLEEP > 0) { > try { > Thread.sleep(SLEEP); > } catch (InterruptedException e) { > // NoOp > } > } > } > private static void createTables(Connection connection, String tableName) > throws SQLException { > try (Statement stmt = connection.createStatement()) { > System.out.println("Creating " + tableName); > stmt.executeUpdate("drop table if exists " + tableName ); > s(); > stmt.executeUpdate(getCreateSql(tableName)); > s(); > } > } > private static String getInsertSql(String tableName) { > StringBuilder sql = new StringBuilder("insert into > ").append(tableName).append(" values(?"); > for (int i = 0; i < COLUMNS; i++) { > sql.append(", ?"); > } > sql.append(")"); > return sql.toString(); > } > private static void insertBatch(PreparedStatement ps) { > int retryCounter = 0; > while(retryCounter <= RETRY) { > try { > ps.executeBatch(); > return; > } catch (SQLException e) { > System.err.println(retryCounter + " error while executing " + > ps + ":" + e); > retryCounter++; > } > } > } > private static void insertData(Connection connection, String tableName) > throws SQLException { > long ts = System.currentTimeMillis(); > try (PreparedStatement ps = > connection.prepareStatement(getInsertSql(tableName))) { > int batch = 0; > for (int i = 0; i < ROWS; i++) { > ps.setInt(1, i); > for (int j = 2; j < COLUMNS + 2; j++) { > ps.setString(j, "value" + i + "_" + j); > } > ps.addBatch(); >
[jira] [Commented] (IGNITE-19247) BatchUpdateException: Replication is timed out" upon inserting rows in batches via JDBC
[ https://issues.apache.org/jira/browse/IGNITE-19247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17723207#comment-17723207 ] Pavel Pereslegin commented on IGNITE-19247: --- [~lunigorn], could you provide the full stack trace of the error? Is there a message "Queue full"? I'm currently working on IGNITE-19278, but the described in it issue can be ran reproduced with the reproducer from current ticket. > BatchUpdateException: Replication is timed out" upon inserting rows in > batches via JDBC > --- > > Key: IGNITE-19247 > URL: https://issues.apache.org/jira/browse/IGNITE-19247 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 3.0 >Reporter: Alexander Belyak >Assignee: Pavel Pereslegin >Priority: Critical > Labels: ignite-3 > Fix For: 3.0 > > Attachments: ReplicationTimeoutReproducerClientLog.zip, > node_0.log.zip, node_1.log.zip, serverLog.zip, test.log > > > Start single node cluster: > {noformat} > git commit 78946d4c > https://github.com/apache/ignite-3.git branch mainbuild by: > ./gradlew clean allDistZip -x test -x integrationTest -x check -x > modernizer > start by: > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ export > IGNITE_HOME=$(pwd) > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ bin/ignite3db start > Starting Ignite 3... > Node named defaultNode started successfully. REST addresses are > [http://127.0.1.1:10300] > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-cli-3.0.0-SNAPSHOT$ bin/ignite3 > cluster init --cluster-endpoint-url=http://localhost:10300 --cluster-name=c1 > --meta-storage-node=defaultNode > Cluster was initialized successfully{noformat} > Code below just create tables with columns (int key and > varchar cols) and insert rows into each table (with SLEEP ms interval > between operations, with attemps. > > {noformat} > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > public class TimeoutExceptionReproducer { > private static final String DB_URL = "jdbc:ignite:thin://127.0.0.1:10800"; > private static final int COLUMNS = 10; > private static final String TABLE_NAME = "K"; > private static final int ROWS = 10; > private static final int TABLES = 3; > private static final int BATCH_SIZE = 100; > private static final int SLEEP = 0; > private static final int RETRY = 1; > private static String getCreateSql(String tableName) { > StringBuilder sql = new StringBuilder("create table > ").append(tableName).append(" (id int primary key"); > for (int i = 0; i < COLUMNS; i++) { > sql.append(", col").append(i).append(" varchar NOT NULL"); > } > sql.append(")"); > return sql.toString(); > } > private static final void s() { > if (SLEEP > 0) { > try { > Thread.sleep(SLEEP); > } catch (InterruptedException e) { > // NoOp > } > } > } > private static void createTables(Connection connection, String tableName) > throws SQLException { > try (Statement stmt = connection.createStatement()) { > System.out.println("Creating " + tableName); > stmt.executeUpdate("drop table if exists " + tableName ); > s(); > stmt.executeUpdate(getCreateSql(tableName)); > s(); > } > } > private static String getInsertSql(String tableName) { > StringBuilder sql = new StringBuilder("insert into > ").append(tableName).append(" values(?"); > for (int i = 0; i < COLUMNS; i++) { > sql.append(", ?"); > } > sql.append(")"); > return sql.toString(); > } > private static void insertBatch(PreparedStatement ps) { > int retryCounter = 0; > while(retryCounter <= RETRY) { > try { > ps.executeBatch(); > return; > } catch (SQLException e) { > System.err.println(retryCounter + " error while executing " + > ps + ":" + e); > retryCounter++; > } > } > } > private static void insertData(Connection connection, String tableName) > throws SQLException { > long ts = System.currentTimeMillis(); > try (PreparedStatement ps = > connection.prepareStatement(getInsertSql(tableName))) { > int batch = 0; > for (int i = 0; i < ROWS; i++) { > ps.setInt(1, i); > for (int j = 2; j < COLUMNS + 2; j++) { >
[jira] [Commented] (IGNITE-19247) BatchUpdateException: Replication is timed out" upon inserting rows in batches via JDBC
[ https://issues.apache.org/jira/browse/IGNITE-19247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17723198#comment-17723198 ] Igor commented on IGNITE-19247: --- Retry on Ignite 3 main branch commit 45380a6c802203dab0d72bd1eb9fb202b2a345b0 doesn't reproduce the bug. Bug there is another one exception. I'll create a bug for it. {code:java} Exception while executing query [query=SELECT COUNT(*) FROM rows_capacity_table]. Error message:IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 Query remote fragment execution failed: nodeName=TablesAmountCapacityTest_cluster_0, queryId=ecd14026-5366-4ee2-b73a-f38757d3ba4f, fragmentId=1561, originalMessage=IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 java.sql.SQLException: Exception while executing query [query=SELECT COUNT(*) FROM rows_capacity_table]. Error message:IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 Query remote fragment execution failed: nodeName=TablesAmountCapacityTest_cluster_0, queryId=ecd14026-5366-4ee2-b73a-f38757d3ba4f, fragmentId=1561, originalMessage=IGN-CMN-1 TraceId:24c93463-f078-410a-8831-36b5c549a907 at org.apache.ignite.internal.jdbc.proto.IgniteQueryErrorCode.createJdbcSqlException(IgniteQueryErrorCode.java:57) at org.apache.ignite.internal.jdbc.JdbcStatement.execute0(JdbcStatement.java:149) at org.apache.ignite.internal.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:108) {code} > BatchUpdateException: Replication is timed out" upon inserting rows in > batches via JDBC > --- > > Key: IGNITE-19247 > URL: https://issues.apache.org/jira/browse/IGNITE-19247 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 3.0 >Reporter: Alexander Belyak >Assignee: Pavel Pereslegin >Priority: Critical > Labels: ignite-3 > Fix For: 3.0 > > Attachments: ReplicationTimeoutReproducerClientLog.zip, > node_0.log.zip, node_1.log.zip, serverLog.zip, test.log > > > Start single node cluster: > {noformat} > git commit 78946d4c > https://github.com/apache/ignite-3.git branch mainbuild by: > ./gradlew clean allDistZip -x test -x integrationTest -x check -x > modernizer > start by: > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ export > IGNITE_HOME=$(pwd) > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-db-3.0.0-SNAPSHOT$ bin/ignite3db start > Starting Ignite 3... > Node named defaultNode started successfully. REST addresses are > [http://127.0.1.1:10300] > /tmp/ignite3-3.0.0-SNAPSHOT/ignite3-cli-3.0.0-SNAPSHOT$ bin/ignite3 > cluster init --cluster-endpoint-url=http://localhost:10300 --cluster-name=c1 > --meta-storage-node=defaultNode > Cluster was initialized successfully{noformat} > Code below just create tables with columns (int key and > varchar cols) and insert rows into each table (with SLEEP ms interval > between operations, with attemps. > > {noformat} > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.PreparedStatement; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > public class TimeoutExceptionReproducer { > private static final String DB_URL = "jdbc:ignite:thin://127.0.0.1:10800"; > private static final int COLUMNS = 10; > private static final String TABLE_NAME = "K"; > private static final int ROWS = 10; > private static final int TABLES = 3; > private static final int BATCH_SIZE = 100; > private static final int SLEEP = 0; > private static final int RETRY = 1; > private static String getCreateSql(String tableName) { > StringBuilder sql = new StringBuilder("create table > ").append(tableName).append(" (id int primary key"); > for (int i = 0; i < COLUMNS; i++) { > sql.append(", col").append(i).append(" varchar NOT NULL"); > } > sql.append(")"); > return sql.toString(); > } > private static final void s() { > if (SLEEP > 0) { > try { > Thread.sleep(SLEEP); > } catch (InterruptedException e) { > // NoOp > } > } > } > private static void createTables(Connection connection, String tableName) > throws SQLException { > try (Statement stmt = connection.createStatement()) { > System.out.println("Creating " + tableName); > stmt.executeUpdate("drop table if exists " + tableName ); > s(); > stmt.executeUpdate(getCreateSql(tableName)); > s(); > } > } > private static String