spaghettidba/WorkloadTools

Error: PK Violation Intervals

Closed this issue · 0 comments

Replaying a captured workload leads to a foreign key violation and subsequent exit of the replay process.

Environment:
-SQL Server 2017-CU25
-Windows Server 2019
-WorkloadTools Release v1.5.14 (latest)
-StackOverflow2010 Database

Interestingly this only happens in the second resp. benchmark replay (with indexes added) and not in the baseline replay.

2021-10-04 14:19:43.7230 - Error - SqlWorkload.Program : System.Data.SqlClient.SqlException (0x80131904): Verletzung der PRIMARY KEY-Einschränkung "PK__Interval__6ED7FE587C743073". Ein doppelter Schlüssel kann in das change.Intervals-Objekt nicht eingefügt werden. Der doppelte Schlüsselwert ist (642368152). at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.CreateInterval(SqlConnection conn, SqlTransaction tran, DateTime intervalTime) in C:\GitHub\WorkloadTools\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 800
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.WriteToServer(DateTime intervalTime) in C:\GitHub\WorkloadTools\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 419
at WorkloadTools.Consumer.Analysis.WorkloadAnalyzer.Stop() in C:\GitHub\WorkloadTools\WorkloadTools\Consumer\Analysis\WorkloadAnalyzer.cs:line 375
at WorkloadTools.Consumer.Analysis.AnalysisConsumer.Dispose(Boolean disposing) in C:\GitHub\WorkloadTools\WorkloadTools\Consumer\Analysis\AnalysisConsumer.cs:line 71
at WorkloadTools.WorkloadController.Dispose() in C:\GitHub\WorkloadTools\WorkloadTools\WorkloadController.cs:line 110
at SqlWorkload.Program.Run(Options options) in C:\GitHub\WorkloadTools\SqlWorkload\Program.cs:line 116
at SqlWorkload.Program.Main(String[] args) in C:\GitHub\WorkloadTools\SqlWorkload\Program.cs:line 47
ClientConnectionId:b7157757-29df-434c-aac8-0d66886d3029
Error Number:2627,State:1,Class:14
`