Projection output stream lost all the data coming from one of the input stream

Hi,

On Friday, we had an Event Store projections where the output stream lost all the past data associated to an input stream that somehow disappeared from the definition.

In Event Store, the projection code ended up looking like (no more input_stream_4):

fromStreams([“input_stream_1”,“input_stream_2”,“input_stream_3”])

.when({

$any : function(s,e){

linkTo(“output_stream”, e);

}

})

Instead of what we had created and was there before:

fromStreams([“input_stream_1”,“input_stream_2”,“input_stream_3”,“input_stream_4”])

.when({

$any : function(s,e){

linkTo(“output_stream”, e);

}

})

When we added it back and restarted the projection, all the missing data went to the top as we would’ve expected. We tried to reproduce the issue by manually removing one of the input stream but that seem to only affect new events and doesn’t seem to remove the old data.

Not sure if this is related but we also had another issue a few days before that could’ve been triggered by backups failing due to disk full. Here’s the previous post: https://groups.google.com/forum/#!topic/event-store/CET_uBIzzGY

Any ideas what happened here? Is this something related to how you create or write to a projection?

Thanks,

Jean-Philippe

We’re using Event Store v4.0.3.0

If you look at the stream $projections-projectionName can you see the projection definition being changed? The timestamps might give a clue of what did it.

Thanks for the information on the $projections-* stream. it helped us clear up a few unknowns about how this works.

It looks like the issue is on our side since we thought that by changing the projection definition in the code and calling the EventStore api, it would update it in Event Store but that’s not the case after all.

The issue was in our code where in some case we would monitor the projection to know if new events would come in but, in some cases, we would query each of the input stream directly to get the data instead of the built projections. We fixed that and everything is working fine now.

Is there a way to update a projection definition through the API without having to recreate it?

Thanks,

Jean-Philippe