Multistream projections don't always start properly when maxAge is set on the input stream #4259
Labels
good first issue
This is a good first issue for anyone that wants to start contributing to EventStoreDB
kind/bug
Issues which are a software defect
subsystem/projections
Issues relating to the projections framework
Describe the bug
If
$maxAge
or$maxCount
is set on the input stream of afromStreams
projection, the projection can get stuck in theStarting/StateLoaded
state when it starts up.This seems to happen in the specific case where events in the input stream are missing after the checkpoint of the projection, but there are still some events in the input stream. The error logged in the server is coming from MultiStreamMultiOutputCheckpointManager where it will throw an exception even if the read was successful if it is empty
To Reproduce
The easiest way to reproduce this is with
$maxCount
because it is more deterministic than$maxAge
:test-stream1
.$maxCount
ontest-stream1
to 5. (This can also be achieved by setting the$maxAge
and waiting for some of the events to expire)Started/StateLoaded
state.Expected behavior
The projection starts up and continues processing events.
Or at the very least, the projection should fault and get into a state which the user can recover it from.
Actual behavior
Starting/StateLoaded
state.EventStore details
Additional context
This appears to be similar to #1333
The projection can be recovered by removing the
$maxAge
or$maxCount
metadata on the input streams.$maxCount
can be safely set to a number larger than the projection's checkpoint count.The text was updated successfully, but these errors were encountered: