Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Creating an emitting one-time projection without checkpoints breaks Projection Manager #86

Closed
JamesTryand opened this Issue · 1 comment

3 participants

@JamesTryand

This is from the binary release 2.0.1 running on windows7 64bit.
padmin used was from the source build (commit : 8ef23af )

Tried creating the following projection (which had been previously verified without the emit)
fromStream('enquiry').
when({
$init : function() { return { totalcount : 0, count : 0, faultevents : { }, previousid : 0, previousevent : {} } },
$any: function(s,e) {
var currentid = e.metadata.EventId; // 100% had previously been verified to have this property.
if (s.previousid + 1 != currentid) {
s.count += 1;
}
s.totalcount += 1;
s.doubleprevious = s.previousevent;
s.previousid = currentid;
s.previousevent = e;
var subarray = [];
for (var i = s.previousid + 1; i < currentid; i++) { subarray.push(i); }
emit("MissingRecords","MissingRecordSet", { top : s.previousevent, tail : s.doubleprevious, missingSubCount : subarray.length, missingSubArray : subarray }, { topMetadata : s.previousevent.metadata, tailMetadata : s.doubleprevious.metadata })
return s;
}
})fromStream('enquiry').
when({
$init : function() { return { totalcount : 0, count : 0, faultevents : { }, previousid : 0, previousevent : {} } },
$any: function(s,e) {
var currentid = e.metadata.EventId; // 100% had previously been verified to have this property.
if (s.previousid + 1 != currentid) {
s.count += 1;
}
s.totalcount += 1;
s.doubleprevious = s.previousevent;
s.previousid = currentid;
s.previousevent = e;
var subarray = [];
for (var i = s.previousid + 1; i < currentid; i++) { subarray.push(i); }
emit("MissingRecords","MissingRecordSet", { top : s.previousevent, tail : s.doubleprevious, missingSubCount : subarray.length, missingSubArray : subarray }, { topMetadata : s.previousevent.metadata, tailMetadata : s.doubleprevious.metadata })
return s;
}
})

As a One-Time mode of projection, with
Emit Enabled
and was immediately Enabled.

This then errors, but doesn't become visible in the web console ( but is listed via padmin ).

The log gives the following error:
[06052,14,12:02:08.438] Error while processing message WRITE COMPLETED: CorrelationId: 49409e56-0227-4590-ac84-c0151d0b5558, Result: Success, Message: , FirstEventNumber: 6 in queued handler 'Projections Master'.
Emit requires checkpoints

and then

[06052,14,12:02:55.997] Error while processing message EventStore.Projections.Core.Messages.ProjectionManagementMessage+Delete in queued handler 'Projections Master'.
Cannot stop a projection in the 'Creating' state

Padmin gives the following exception
.\padmin.exe delete TheFourPercent admin changeit
Loading config values...
Deleting TheFourPercent...
padmin execution failed : System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at EventStore.ClientAPI.Transport.Http.WebRequestExtensions.EndGetResponseExtended(WebRequest request, IAsyncResult asyncResult) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\WebRequestExtensions.cs:line 48
at EventStore.ClientAPI.Transport.Http.HttpAsyncClient.ResponseAcquired(IAsyncResult ar) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\HttpAsyncClient.cs:line 175
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at EventStore.Padmin.Command.Delete(ProjectionsManager manager, String[] commandArgs) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Command.cs:line 177
at EventStore.Padmin.Program.Execute(ProjectionsManager manager, String[] args) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Program.cs:line 98
at EventStore.Padmin.Program.TryExecute(Dictionary`2 config, String[] args) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Program.cs:line 81
---> (Inner Exception #0) System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at EventStore.ClientAPI.Transport.Http.WebRequestExtensions.EndGetResponseExtended(WebRequest request, IAsyncResult asyncResult) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\WebRequestExtensions.cs:line 48
at EventStore.ClientAPI.Transport.Http.HttpAsyncClient.ResponseAcquired(IAsyncResult ar) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\HttpAsyncClient.cs:line 175<---

(prior to setup had created a stream with a metadata field of 'EventId' that is a sequentially incrementing long value)

@ysw
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.