[QUESTION] ExceededMaxResultBufferException on a big transaction with maxResultBuffer property applied
See original GitHub issueQuestion
I’m trying to understand behavior of the maxResultBuffer
connection property.
Setup: Debezium Server is used to stream transactions from a source MSSQL Database to a downstream system.
Given: when there is a “big” transaction (for example, many rows are inserted in a single transaction), the process fails with an OOM error. My assumption was that if I apply maxResultBuffer
connection string property, my “big” transaction would be split up into chunks of size equal or less than the maxResultBuffer
and chunks will be processed one by one. This will ultimately save me from the OOM.
Instead, when the transaction is executed, the process first gets the “MaxResultBuffer property exceeded…” log error and then fails with the “com.microsoft.sqlserver.jdbc.SQLServerException” “The TDS protocol stream is not valid.”.
Is it an expected behavior to get an exception when the MaxResultBuffer value is exceeded and how should it be handled?
Relevant Issues and Pull Requests
maxResultBuffer doc: https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver16 maxResultBuffer PR: https://github.com/microsoft/mssql-jdbc/pull/1431
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thanks for an explanation! Closing the topic.
Thanks. I was able to confirm
maxResultBuffer
is being used correctly in this case. As for how to handle the actual overflow, it’s not handled by the driver, and expected to be handled somewhere else.maxResultBuffer
is only responsible for limiting how much is read. For a Debezium solution you can use max.queue.size and max.queue.size.in.bytes.