Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix cases where projections are just buffering #1303
There exists a couple obscure cases where projections appear to just
The fixes are as follows
1. Projection writes a checkpoint with a WrongExpectedVersion
2. After restart a projection still attempts to process writes coming
back from before the restart
I attempted to write a test but the test setup does not replicate the
Tested this with the following:
- Change the projection checkpoint count to 10.
- Disable all projections but
- Add a line in
StorageWriterServicethat will slow writes down by 500ms for the stream
- Start the event store with the projection running.
- Using the testclient, write 18 events - this causes one checkpoint to be written for
- Write a fake checkpoint event to the
$etstream, using the same metadata as the previous event in that stream.
- Write a fake emitted event to the
$et-TakeSomeSpaceEventstream, also using the same metadata as the previous event.
- Write one more event using the test client.
Before this change, this would cause the projection to fault. After this change, the projection restarts and continues processing and emitting events, as well as writing checkpoints.
I've also verified that if an event is written with incorrect metadata the projection still faults saying that the stream has been written to from the outside.