New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how registered projections are read #1325

Merged
merged 1 commit into from Jun 2, 2017

Conversation

2 participants
@pgermishuys
Member

pgermishuys commented Jun 2, 2017

There is a case where projections that have been deleted can come back to life due to the way that registered projections are currently read.

Reproduction Steps:

  1. Create 200 (double the current batch size) projections and then delete the first projection and don't
    specify that you want any of it's state streams deleted.
  2. Restart Event Store.
    The projection that you have deleted will start up in a stopped state

To remedy this, the way the registration stream is being read has been
changed from the hard to reason about reading the stream backwards
and then using grouping logic to determine whether the projection is
alive/dead.

It has been changed to reading the stream forwards from the beginning and
building up state which represents the projections which are alive.

Another part of this commit addresses the issue of hardcoded strings in
particular those that pertain to the registered projections, namely the
projection registration stream ($projections-$all), the event types such
as $ProjectionCreated, $ProjectionDeleted, $ProjectionsInitialized as
well as the $ProjectionUpdated (which is written to the projection's
configuration stream $projections-{name})

Reading registered projections in batches can cause deleted projections
to come alive.

Reproduction Steps:

1. Create 200 (double the current batch size) projections and then delete the first projection and don't
specify that you want any of it's state streams deleted.
2. Restart Event Store.
The projection that you have deleted will start up in a stopped state

To remedy this, the way the registration stream is being read has been
changed from the hard to reason about reading the stream backwards
and then using grouping logic to determine whether the projection is
alive/dead.

It has been changed to reading the stream forwards from the beginning and
building up state which represents the projections which are alive.

Another part of this commit addresses the issue of hardcoded strings in
particular those that pertain to the registered projections, namely the
projection registration stream ($projections-$all), the event types such
as $ProjectionCreated, $ProjectionDeleted, $ProjectionsInitialized as
well as the $ProjectionUpdated (which is written to the projection's
configuration stream $projections-{name})
@hayley-jean

Following the test steps, I have verified that the deleted projection now stays deleted.

@hayley-jean hayley-jean merged commit 9849a43 into release-v4.0.2 Jun 2, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
wercker/build-mono4 Wercker pipeline passed
Details

@hayley-jean hayley-jean deleted the projection-registration-cleanup branch Jun 2, 2017

hayley-jean added a commit that referenced this pull request Jul 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment