dotnetcore / CAP

Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
http://cap.dotnetcore.xyz
MIT License
6.61k stars 1.28k forks source link

SQL Server replication readpast error! "You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels" #1543

Closed syond0915 closed 3 months ago

syond0915 commented 3 months ago

Category: DotNetCore.CAP.Processor.MessageNeedToRetryProcessor EventId: 1

Get messages from storage failed. Retrying...

Exception: Microsoft.Data.SqlClient.SqlException (0x80131904): You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels. at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) at Microsoft.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) at Microsoft.Data.SqlClient.SqlDataReader.Read() at DotNetCore.CAP.SqlServer.SqlServerDataStorage.<GetMessagesOfNeedRetryAsync>b__18_0(IDataReader reader) at DotNetCore.CAP.SqlServer.DbConnectionExtensions.ExecuteReader[T](IDbConnection connection, String sql, Func2 readerFunc, Object[] sqlParams) at DotNetCore.CAP.SqlServer.SqlServerDataStorage.GetMessagesOfNeedRetryAsync(String tableName) at DotNetCore.CAP.SqlServer.SqlServerDataStorage.GetMessagesOfNeedRetryAsync(String tableName) at DotNetCore.CAP.SqlServer.SqlServerDataStorage.GetReceivedMessagesOfNeedRetry() at DotNetCore.CAP.Processor.MessageNeedToRetryProcessor.GetSafelyAsync[T](Func`1 getMessagesAsync) ClientConnectionId:d6aabc8d-5ddb-4adb-944c-602301eee7c8 Error Number:650,State:1,Class:16

image

carlosxjose commented 3 months ago

@syond0915 it looks like you are working with a SQL Server replication scenario ???

If so did you exclude the caps databases?

yang-xiaodong commented 3 months ago

@syond0915 it looks like you are working with a SQL Server replication scenario ???

If so did you exclude the caps databases?

Thanks @carlosxjose for the answer. Yes, he is using SQL Server replication.

syond0915 commented 3 months ago

Warning still alive, how should I handle it?