在截断和插入几百万行的几个较大的存储过程中,我们在 DMS 中至少有 30% 或更多的时间出现死锁。但是,只有一个查询正在运行,所以我看不出死锁是我的错:
Msg 110802, Level 16, State 1, Line 1
110802;An internal DMS error occurred that caused this operation to fail. Details: Exception: Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DmsSqlNativeException, Message: SqlNativeBufferReader.Run, error in OdbcExecuteQuery: SqlState: 40001, NativeError: 1205, 'Error calling: SQLExecDirect(this->GetHstmt(), (SQLWCHAR *)statementText, SQL_NTS), SQL return code: -1 | SQL Error Info: SrvrMsgState: 71, SrvrSeverity: 13, Error <1>: ErrorMsg: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Transaction (Process ID 2265) was deadlocked on lock | generic waitable object resources with another process and has been chosen as the deadlock victim. Rerun the transaction. | Error calling: pReadConn->ExecuteQuery(statementText, bufferFormat) | state: FFFF, number: 7801, active connections: 120', Connection String: Driver={pdwodbc};APP=TypeC01-DmsNativeReader:DB3\mpdwsvc (13732)-ODBC;Trusted_Connection=yes;AutoTranslate=no;Server=\\.\pipe\DB.3-b6c0a7b26544\sql\query
和:
110802;An internal DMS error occurred that caused this operation to fail. Details: Exception: Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DmsSqlNativeException, Message: SqlNativeBufferReader.Run, error in OdbcExecuteQuery: SqlState: 40001, NativeError: 1205, 'Error calling: SQLExecDirect(this->GetHstmt(), (SQLWCHAR *)statementText, SQL_NTS), SQL return code: -1 | SQL Error Info: SrvrMsgState: 71, SrvrSeverity: 13, Error <1>: ErrorMsg: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Transaction (Process ID 804) was deadlocked on lock | generic waitable object resources with another process and has been chosen as the deadlock victim. Rerun the transaction. | Error calling: pReadConn->ExecuteQuery(statementText, bufferFormat) | state: FFFF, number: 8106, active connections: 240', Connection String: Driver={pdwodbc};APP=TypeC01-DmsNativeReader:DB38\mpdwsvc (14728)-ODBC;Trusted_Connection=yes;AutoTranslate=no;Server=\\.\pipe\DB.38-b6c0a7b26544\sql\query
这点是否明显需要检查或修复?还是 Azure 支持案例是解决问题的最佳途径?
更新:支持案例 115111713384329 已针对此问题开放
更新:我们的 SQL DW 在 2016 年 3 月 4 日获得了一个新的更新,据说它修复了这个问题。(我不能按需复制它,所以我不能肯定地说。)如果你运行“select @@version”,那么 10.0.8224.5 或更高版本应该有修复。如果您还没有修复程序,我想打开一个支持案例并请求它或等待几周会让您得到修复程序。