Possible Bug in Ncqrs.EventBus

142 views
Skip to first unread message

theBoringCoder

unread,
May 15, 2013, 12:27:07 AM5/15/13
to ncqr...@googlegroups.com
I think I may have found a bug, but I can't put my finger on the exact cause.  Steps to reproduce:
  • Configure and run the MyNotes sample
    • Add a new note
    • Edit note #1
    • Edit note #1 a second time
    • Edit note #1 a third time
    • Add a new note
  • Stop the MyNotes sample
  • Run these queries
    • SELECT * FROM [MyNotesEventStore].[dbo].[EventSources]
    • SELECT * FROM [MyNotesEventStore].[dbo].[Events]
    • SELECT * FROM [Snapshots]
    • SELECT * FROM [PipelineState]
  • Note that the sequential order of the [PipelineState] table matches the sequential order of what you did when you ran the app, and the sequential order of the [Events] table
  • Run these queries
    • TRUNCATE TABLE [MyNotesReadModel].[dbo].[NoteItemSet]
    • TRUNCATE TABLE [MyNotesReadModel].[dbo].[TotalsPerDayItemSet]
    • TRUNCATE TABLE [MyNotesEventStore].[dbo].[PipelineState]
  • Run the MyNotes sample
    • Notice that when the ApplicationService starts up, it replays the events in the wrong order
    • Do not add any new notes or change the text of any existing notes
  • Stop the MyNotes sample
  • Run these queries
    • SELECT * FROM [MyNotesEventStore].[dbo].[EventSources]
    • SELECT * FROM [MyNotesEventStore].[dbo].[Events]
    • SELECT * FROM [Snapshots]
    • SELECT * FROM [PipelineState]
    • Notice that the order of the entries in [PipelineState] is incorrect
  • Run the MyNotes sample
    • Notice that the ApplicationService reprocesses the Event with a SequentialId of 5--because the last entry in [PipelineState] indicates that the last event processed was the Event with a SequentialId of 4.
I've spent a few hours tracing through the code, and I *think* (remember, I said I couldn't put my finger on the cause) the problem is in either the Pipeline or Demultiplexer.
 
I'd be much abliged if someone could look at this and figure out what the problem is.
 
thanks,
 
Tom
theBoringCoder

Pieter Joost van de Sande

unread,
May 15, 2013, 1:10:45 AM5/15/13
to ncqr...@googlegroups.com
I can take a look at this at the end of this week, early next week.
--
You received this message because you are subscribed to the Google Groups "ncqrs-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ncqrs-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Message has been deleted

theBoringCoder

unread,
May 16, 2013, 2:31:41 PM5/16/13
to ncqr...@googlegroups.com
Super. I figured out a little more of what's going on--apologies, I'm not very good at debugging multi-threaded scenarios: In Ncqrs.EventBus.MsSqlServerEventStoreElementStore, when you are replaying all the events in the database, the events arrive out of order to the MarkLastProcessedElement() method.  This causes the data in the PipelineState table to be out of order with regards to the data in the Event table.

tcbo...@gmail.com

unread,
Jun 2, 2013, 7:02:30 PM6/2/13
to ncqr...@googlegroups.com
Anyone see a resolution for this problem?
 
Sent from Windows Mail
 

Alex Pollan

unread,
Oct 4, 2013, 8:40:03 AM10/4/13
to ncqr...@googlegroups.com
I repeated these steps and couldn't reproduce the problem.
All was fine in my test.
Someone had fixed the problem?
Reply all
Reply to author
Forward
0 new messages