ERROR #1027 DSI EXEC(104(1) repdb_svr.rep_db) - /dsiutil.c(390) Open Client Client-Library error: Error: -99999, Severity 5 -- 'Values exceed buffer length'. ERROR #5215 DSI EXEC(104(1) repdb_svr.rep_db) - /dsiutil.c(393) The interface function 'SQLPrepare' returns FAIL for database 'repdb_svr.rep_db'. The errors are retryable. The DSI thread will restart automatically. See messages from the interface function for more information.
RANT: While Replication Server says it is retryable, it never actually retries.
It is for the DSI connection but which buffer?? Replication Server doesn’t list any “buffers” for the DSI explicitly. There are a myriad of caches for the DSI connection. In the error message I see two hints to narrow it down: “Values exceed” and “SQLPrepare”. The most likely cache candidates, to me, would be the batch size (dsi_cmd_batch_size) and the dynamic sql cache (dynamic_sql_cache_size).
A simple check would be to disable dynamic SQL and see if we get the same error message:
suspend connection to repdb_svr.rep_db go alter connection repdb_svr.rep_db set dynamic_sql to 'off' go resume connection to repdb_svr.rep_db go
Within a few seconds, I received the same message, so that wasn’t the culprit. Before we do anything else, let’s reenable the dynamic sql:
suspend connection to repdb_svr.rep_db go alter connection repdb_svr.rep_db set dynamic_sql to 'on' go
That leaves the batch size as the most likely culprit. So let’s increase that and see what happens:
suspend connection to repdb_svr.rep_db go admin who, dsi, repdb_svr, rep_db go -- record Cmd_batch_size (default is 8192 -- Increase dsi_cmd_batch_size alter connection repdb_svr.rep_db set dsi_cmd_batch_size to '32768' go resume connection to repdb_svr.rep_db go
The error message did not reoccur and I see replication moving by monitoring the admin,sqm in rep server and the rs_lastcommit table in the replicate database to ensure we’re moving.
You may ask what changed that would require increasing the batch size. Well, a very large transaction that was trying to insert data that already existed but since not all the data already existed, we needed to change INSERT into DELETE followed by INSERT:
alter connection to repdb_svr.rep_db set dsi_command_convert to 'i2di'
Why would that cause it to go boom? Well, the dsi_command_convert is applied AFTER replication server slices and dices the transactions into batches.