I was not able to diagnose this any further in the last few weeks, but the problem still persists.
I don’t get drop’s, except those that I initiate myself (because of the mentioned skips). (Sidenote: Maybe the ClientAPI should have this check integrated? There should not be a reason why the version of a processed event is not exactly lastProcessedVersion + 1).
Looking at the logs, I did find the following combination which seems odd:
13:30:30.097 Fri Feb 20 12:30:30.0644 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: EventAppeared with eventNumber: 1, Thread ID: 46
13:30:30.097 Fri Feb 20 12:30:30.0644 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: Event appeared of type “ForumCreatedEvent”, received: 1, expected: 1, used subscription: 7340066
13:30:30.097 Fri Feb 20 12:30:30.0644 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: Handling event of type ForumCreatedEvent with version 1, used subscription: 7340066
13:30:30.142 Fri Feb 20 12:30:30.1241 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: latency was 1.4173962 s.
13:30:30.142 Fri Feb 20 12:30:30.1241 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: Handled event of type ForumCreatedEvent with version 1, used subscription: 7340066, Thread ID: 46
13:30:30.142 Fri Feb 20 12:30:30.1241 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: processed event (context-forum, 1, $> @ 1).
// Looks good, 2nd event (=version 1) appeared, was handled/processed, everything went fine
13:30:30.142 Fri Feb 20 12:30:30.1241 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: finished reading events, nextReadEventNumber = 2.
13:30:30.142 Fri Feb 20 12:30:30.1241 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: subscribing…
// not sure why it says subscribing (should already be subscribed?) but nextReadEventNumber = 2 looks okay, version 2 should be the next appearing version
13:30:31.522 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Subscription {02dec189-c893-49cd-9676-bd4fd9aa4f22} to context-forum: subscribed at CommitPosition: 425148, EventNumber: 3.
// EventNumber 3 looks suspicious, as version 2 should be next
13:30:31.522 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Subscription {02dec189-c893-49cd-9676-bd4fd9aa4f22} to context-forum: event appeared (context-forum, 4, $> @ 427009/427009).
13:30:31.522 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Subscription {02dec189-c893-49cd-9676-bd4fd9aa4f22} to context-forum: event appeared (context-forum, 5, $> @ 430400/430400).
13:30:31.522 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Subscription {02dec189-c893-49cd-9676-bd4fd9aa4f22} to context-forum: event appeared (context-forum, 6, $> @ 430637/430637).
// Now it’s definitely going wrong, two and three were not processed and it received 4
13:30:31.534 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: event appeared (context-forum, 4, $> @ 427009/427009).
13:30:31.534 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: event appeared (context-forum, 5, $> @ 430400/430400).
13:30:31.535 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: event appeared (context-forum, 6, $> @ 430637/430637).
13:30:31.535 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: EventAppeared with eventNumber: 4, Thread ID: 13
13:30:31.535 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: Event appeared of type “ForumCreatedEvent”, received: 4, expected: 2, used subscription: 7340066
13:30:31.535 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Error, PersistentProjectionModule “forum”: Error during projection processing, missed version, received: 4, expected: 2, previous: 1 FatalErrorCritical
// Here my app aborted processing, as it says in this line, the previous processed event was version 1 (correct), it expected version 2 (correct), it received version 4 (bad).
// Since this should never happen and processing can’t correctly occur with missing events, I throw an exception here.
13:30:31.535 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: pulling events (if left)…
13:30:31.550 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, EventStoreConnection ‘ES-6cf04c4a-a197-457f-b4ff-ee60927331bf’: StartOperation schedule ReadStreamEventsForwardOperation, Stream: context-forum, FromEventNumber: 2, MaxCount: 50, ResolveLinkTos: True, RequireMaster: True, -1, 00:00:07…
13:30:31.550 Fri Feb 20 12:30:31.4980 +00:00 2015 ProjectionHost (MyHostname) : Trace, EventStoreConnection ‘ES-6cf04c4a-a197-457f-b4ff-ee60927331bf’: ScheduleOperation package ReadStreamEventsForward, dbec4268-5f4b-47a9-9802-173ba9db6eae, Operation ReadStreamEventsForwardOperation ({dbec4268-5f4b-47a9-9802-173ba9db6eae}): Stream: context-forum, FromEventNumber: 2, MaxCount: 50, ResolveLinkTos: True, RequireMaster: True, retry count: 0, created: 12:30:31.498, last updated: 12:30:31.498…
13:30:31.581 Fri Feb 20 12:30:31.5460 +00:00 2015 ProjectionHost (MyHostname) : Trace, EventStoreConnection ‘ES-6cf04c4a-a197-457f-b4ff-ee60927331bf’: HandleTcpPackage OPERATION DECISION EndOperation (Success), Operation ReadStreamEventsForwardOperation ({dbec4268-5f4b-47a9-9802-173ba9db6eae}): Stream: context-forum, FromEventNumber: 2, MaxCount: 50, ResolveLinkTos: True, RequireMaster: True, retry count: 0, created: 12:30:31.498, last updated: 12:30:31.498.
13:30:31.581 Fri Feb 20 12:30:31.5460 +00:00 2015 ProjectionHost (MyHostname) : Trace, EventStoreConnection ‘ES-6cf04c4a-a197-457f-b4ff-ee60927331bf’: RemoveOperation SUCCEEDED for Operation ReadStreamEventsForwardOperation ({dbec4268-5f4b-47a9-9802-173ba9db6eae}): Stream: context-forum, FromEventNumber: 2, MaxCount: 50, ResolveLinkTos: True, RequireMaster: True, retry count: 0, created: 12:30:31.498, last updated: 12:30:31.498.
// I am not exactly sure what those lines mean, but I guess the exception killed the previous subscription which lead to a re-subscription with the last processed version (2), so everything is more or less working fine.
13:30:31.581 Fri Feb 20 12:30:31.5460 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: EventAppeared with eventNumber: 2, Thread ID: 46
13:30:31.581 Fri Feb 20 12:30:31.5460 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: Event appeared of type “ForumCreatedEvent”, received: 2, expected: 2, used subscription: 7340066
13:30:31.581 Fri Feb 20 12:30:31.5460 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: Handling event of type ForumCreatedEvent with version 2, used subscription: 7340066
13:30:31.620 Fri Feb 20 12:30:31.5958 +00:00 2015 ProjectionHost (MyHostname) : Trace, PersistentProjectionModule “forum”: latency was 1.8884917 s.
13:30:31.620 Fri Feb 20 12:30:31.5958 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: Handled event of type ForumCreatedEvent with version 2, used subscription: 7340066, Thread ID: 46
13:30:31.620 Fri Feb 20 12:30:31.5958 +00:00 2015 ProjectionHost (MyHostname) : Trace, Catch-up Subscription to context-forum: processed event (context-forum, 2, $> @ 2).
13:30:31.620 Fri Feb 20 12:30:31.5958 +00:00 2015 ProjectionHost (MyHostname) : Info, PersistentProjectionModule “forum”: EventAppeared with eventNumber: 3, Thread ID: 46
// after re-subscription, version 2 appeared and (as it was the expected version), everything worked fine.
``
Log line 7 and everything afterwards should be relevant to this case. What would be the next steps to diagnose this further?
Regards