我创建了一个数据迁移工具,可以从旧SQL数据库中读取数据,将其转换为更合理的内容,然后将其存储在RavenDB中。
当我尝试在单个Raven会话中编写22500个1KB对象时,出现以下错误:
System.InvalidOperationException: Could not replicate POST operation to secondary node, failover behavior is: AllowReadsFromSecondaries
该消息表明Master Raven实例遇到了致命错误,迁移工具故障转移到Slave Slave Raven实例并尝试写入它。我不知道的是为什么。
背景资料:
登录Master Raven实例包含以下错误:
System.Threading.ThreadAbortException: Thread was being aborted.
at Microsoft.Isam.Esent.Interop.Implementation.NativeMethods.JetSeek(IntPtr sesid, IntPtr tableid, UInt32 grbit)
at Microsoft.Isam.Esent.Interop.Implementation.JetApi.JetSeek(JET_SESID sesid, JET_TABLEID tableid, SeekGrbit grbit) in C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\JetApi.cs:line 3172
at Microsoft.Isam.Esent.Interop.Api.TrySeek(JET_SESID sesid, JET_TABLEID tableid, SeekGrbit grbit) in C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\MoveHelpers.cs:line 127
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.EnsureDocumentIsNotCreatedInAnotherTransaction(String key, Guid txId) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\StorageActions\Util.cs:line 77
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.AddDocument(String key, Nullable`1 etag, RavenJObject data, RavenJObject metadata) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\StorageActions\Documents.cs:line 296
at Raven.Database.DocumentDatabase.<>c__DisplayClass37.<Put>b__30(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\DocumentDatabase.cs:line 480
at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\TransactionalStorage.cs:line 328
at Raven.Database.DocumentDatabase.Put(String key, Nullable`1 etag, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\DocumentDatabase.cs:line 468
at Raven.Database.DocumentDatabase.<>c__DisplayClass67.<Commit>b__64(DocumentInTransactionData doc) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\DocumentDatabase.cs:line 654
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.CompleteTransaction(Guid txId, Action`1 perDocumentModified) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\StorageActions\General.cs:line 272
at Raven.Database.DocumentDatabase.<>c__DisplayClass67.<Commit>b__63(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\DocumentDatabase.cs:line 658
at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\TransactionalStorage.cs:line 374
at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Storage.Esent\TransactionalStorage.cs:line 334
at Raven.Database.DocumentDatabase.Commit(Guid txId) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\DocumentDatabase.cs:line 668
at Raven.Database.Server.Responders.TransactionCommit.Respond(IHttpContext context) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Server\Responders\TransactionCommit.cs:line 28
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Server\HttpServer.cs:line 582
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Server\HttpServer.cs:line 347
使用复制事务时,每个会话的写入次数是否有上限? 这可能是使用不稳定构建的结果吗?
编辑:在RavenDB Google群组上交叉发布:https://groups.google.com/forum/?fromgroups#!starred/ravendb/FZZ_Q1y59qI
答案 0 :(得分:0)
看起来这可能是一个错误。提供了一个repro,所以希望开发团队的人能够调查它。
有关详情,请参阅RavenDB Google Groups主题https://groups.google.com/forum/?fromgroups#!starred/ravendb/FZZ_Q1y59qI。
将在更多信息可用时更新此答案。
更新:不支持在单个DTC会话中编写这么多对象:https://groups.google.com/d/msg/ravendb/FZZ_Q1y59qI/fimWkX8NZm0J