Projection error

We had an projection die on us:

[PID:03172:016 2015.04.21
07:04:47.580 ERROR ProjectionManager ] The ‘ProjectionFor-Replay’
projection faulted due to ‘An event emitted in recovery differ from the
originally emitted event. Existing(’$>’,
‘C:23407779133/P:23407775222’). New(’$>’, ‘C:23407758301/P:23407754942’)’

Is this beta-related or have we done something stupid?

(The projections is dead simple, just emits all non-internal events into one stream)

/Peter

Beta related I believe @james was looking at this issue.

Cheers,

Greg

Beta related I believe @james was looking at this issue.

Cheers,

Greg

OK, thanks.

Are there any alternatives to using a custom projection if I wanna subscribe to all non-system events, with a single pointer?

(used to do SubscribeFromAll, but have removed code to deal with EventPosition, and not very keen on reimplementing)

/Peter

-----Ursprungligt meddelande-----

"but have removed code to deal with EventPosition, and not very keen
on reimplementing"

You mean the passing/saving of your position? That is +- 2 lines of
code or am I misunderstanding you somehow?

I'm keeping position per projection, so it's a bit more involved, schema in two different databases etc. (and the classic mistake of abstracting too much, so there are a few layers handling this. Simplifying is on the todo list, you live and learn. )

-----Ursprungligt meddelande-----

What data type is your position?

You might be able to use 64bit + 64 bit (eg high/low)

It's int atm, but might be worth changing to something more flexible.

/Peter

If you have enough bits you can treat "positons" as numbers

Hi there,

Any update about this issue?

I had the same issue with EventStore OSS 3.0.1.0 which is running on Windows.

It happens after I shutdown server from UI while events were being saved into EventStore.

Here is the detail error:

[PID:209940:015 2015.05.29 03:29:01.032 ERROR ProjectionManager ] The ‘$by_category’ projection faulted due to ‘An event emitted in recovery differ from the originally emitted event. Existing(’$>’, ‘C:309063/P:309063’). New(’$>’, ‘C:228823/P:228823’)’

[PID:209940:034 2015.05.29 03:29:37.265 ERROR StorageReaderWorker ] Error during processing ReadStreamEventsBackward request.

System.Exception: Invalid order of events has been detected in read index for the event stream ‘$ce-user’. The event 53 at position 323212 goes after the event 55 at position 330867

at EventStore.Core.Services.Storage.StorageReaderWorker.CheckEventsOrder(ReadStreamEventsBackward msg, IndexReadStreamResult result) in c:\EventStore\src\EventStore.Core\Services\Storage\StorageReaderWorker.cs:line 362

at EventStore.Core.Services.Storage.StorageReaderWorker.ReadStreamEventsBackward(ReadStreamEventsBackward msg) in c:\EventStore\src\EventStore.Core\Services\Storage\StorageReaderWorker.cs:line 194

[PID:209940:015 2015.05.29 03:29:50.111 ERROR ProjectionManager ] The ‘$by_category’ projection faulted due to ‘An event emitted in recovery differ from the originally emitted event. Existing(’$>’, ‘C:309063/P:309063’). New(’$>’, ‘C:228823/P:228823’)’

[PID:209940:015 2015.05.29 03:30:32.042 ERROR ProjectionManager ] The ‘$by_category’ projection faulted due to ‘An event emitted in recovery differ from the originally emitted event. Existing(’$>’, ‘C:309063/P:309063’). New(’$>’, ‘C:228823/P:228823’)’

[PID:209940:016 2015.05.29 03:38:03.307 ERROR QueuedHandlerMRES ] Error while processing message EventStore.Projections.Core.Messages.ReaderSubscriptionManagement+Unsubscribe in queued handler ‘Projection Core #0’.

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at EventStore.Projections.Core.Services.Processing.EventReaderCoreService.Handle(Unsubscribe message) in c:\EventStore\src\EventStore.Projections.Core\Services\Processing\EventReaderCoreService.cs:line 132

at EventStore.Core.Bus.MessageHandler`1.TryHandle(Message message) in c:\EventStore\src\EventStore.Core\Bus\MessageHandler.cs:line 33

at EventStore.Core.Bus.InMemoryBus.Publish(Message message) in c:\EventStore\src\EventStore.Core\Bus\InMemoryBus.cs:line 324

at EventStore.Core.Bus.QueuedHandlerMRES.ReadFromQueue(Object o) in c:\EventStore\src\EventStore.Core\Bus\QueuedHandlerMRES.cs:line 121

[PID:209940:018 2015.05.29 03:38:03.307 ERROR QueuedHandlerMRES ] Error while processing message EventStore.Projections.Core.Messages.ReaderSubscriptionManagement+Unsubscribe in queued handler ‘Projection Core #2’.

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at EventStore.Projections.Core.Services.Processing.EventReaderCoreService.Handle(Unsubscribe message) in c:\EventStore\src\EventStore.Projections.Core\Services\Processing\EventReaderCoreService.cs:line 132

at EventStore.Core.Bus.MessageHandler`1.TryHandle(Message message) in c:\EventStore\src\EventStore.Core\Bus\MessageHandler.cs:line 33

at EventStore.Core.Bus.InMemoryBus.Publish(Message message) in c:\EventStore\src\EventStore.Core\Bus\InMemoryBus.cs:line 324

at EventStore.Core.Bus.QueuedHandlerMRES.ReadFromQueue(Object o) in c:\EventStore\src\EventStore.Core\Bus\QueuedHandlerMRES.cs:line 121

[PID:247872:016 2015.05.29 03:38:13.698 ERROR ProjectionManager ] The ‘$by_category’ projection faulted due to ‘An event emitted in recovery differ from the originally emitted event. Existing(’$>’, ‘C:1398952/P:1398952’). New(’$>’, ‘C:228823/P:228823’)’

[PID:247872:008 2015.05.29 03:38:36.799 ERROR StorageReaderWorker ] Error during processing ReadStreamEventsBackward request.

System.Exception: Invalid order of events has been detected in read index for the event stream ‘$ce-user’. The event 177 at position 1412394 goes after the event 179 at position 1419976

at EventStore.Core.Services.Storage.StorageReaderWorker.CheckEventsOrder(ReadStreamEventsBackward msg, IndexReadStreamResult result) in c:\EventStore\src\EventStore.Core\Services\Storage\StorageReaderWorker.cs:line 362

at EventStore.Core.Services.Storage.StorageReaderWorker.ReadStreamEventsBackward(ReadStreamEventsBackward msg) in c:\EventStore\src\EventStore.Core\Services\Storage\StorageReaderWorker.cs:line 194

[PID:247872:017 2015.05.29 03:43:13.197 ERROR QueuedHandlerMRES ] Error while processing message EventStore.Projections.Core.Messages.ReaderSubscriptionManagement+Unsubscribe in queued handler ‘Projection Core #0’.

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at EventStore.Projections.Core.Services.Processing.EventReaderCoreService.Handle(Unsubscribe message) in c:\EventStore\src\EventStore.Projections.Core\Services\Processing\EventReaderCoreService.cs:line 132

at EventStore.Core.Bus.MessageHandler`1.TryHandle(Message message) in c:\EventStore\src\EventStore.Core\Bus\MessageHandler.cs:line 33

at EventStore.Core.Bus.InMemoryBus.Publish(Message message) in c:\EventStore\src\EventStore.Core\Bus\InMemoryBus.cs:line 324

at EventStore.Core.Bus.QueuedHandlerMRES.ReadFromQueue(Object o) in c:\EventStore\src\EventStore.Core\Bus\QueuedHandlerMRES.cs:line 121

Thanks
在 2015年4月22日星期三 UTC+8上午12:01:31,Greg Young写道:

It can happen during cluster takeover as well. There is currently a
fix under way for this.

Thanks Greg

After I reset the faulted projection it goes fine. It might be a temporary workaround.

在 2015年5月29日星期五 UTC+8下午5:06:44,Greg Young写道:

Yes a reset should have it work without issue.

There is work now going to resolve the issue with the checkpointing in
that condition.

Cheers,

Greg