Description
We encountered the JdbcMeta statement IDs concurrency problems that lead to errors pulling the data from avatica JDBC remote http server under heavy load.
The error stack trace for the error is attached.
Our setup: Avatica JDBC remote http server handled by Calcite on the server side.
For the record we had not been able to reproduce the same problems with Avatica, only remote proxy connected directly to DB.
We believe that the cause of the problem is unsynchronized increment of connection.statementCount
see MetaImpl.createStatement
https://github.com/apache/calcite-avatica/blob/master/core/src/main/java/org/apache/calcite/avatica/MetaImpl.java#L213
public StatementHandle createStatement(ConnectionHandle ch) { return new StatementHandle(ch.id, connection.statementCount++, null); }
Suggested fix is to use AtomicInteger for statementCount.
Our stress tests show that the problem is resolved by the fix..
Attachments
Attachments
Issue Links
- relates to
-
CALCITE-906 Avatica JdbcMeta statement IDs are not unique
- Closed
-
CALCITE-636 Connection isolation for Avatica clients
- Closed
- links to