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

Closed
JamesTryand opened this Issue Jan 22, 2014 · 1 comment

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@ysw

ysw Jan 22, 2014

Member

James,

currently only continuously running projections use checkpoints by default.
Emitting any events from a projection requires checkpoints to be enabled.
when posting a projection via http you can enable checkpoints for one-time
projection by appending checkpoints=yes to the url.

The padmin tool is quite limited and does not allow specifying these
details.

best regards
Yuriy

On Wed, Jan 22, 2014 at 2:15 PM, JamesTryand notifications@github.comwrote:

This is from the binary release 2.0.1 running on windows7 64bit.
padmin used was from the source build (commit : 8ef23afhttps://github.com/EventStore/EventStore/commit/8ef23af341976d4f92580cdae28921bd0e325393)

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)


Reply to this email directly or view it on GitHubhttps://github.com/EventStore/EventStore/issues/86
.

Yuriy Solodkyy
(y.solodkyy@gmail.com)

Member

ysw commented Jan 22, 2014

James,

currently only continuously running projections use checkpoints by default.
Emitting any events from a projection requires checkpoints to be enabled.
when posting a projection via http you can enable checkpoints for one-time
projection by appending checkpoints=yes to the url.

The padmin tool is quite limited and does not allow specifying these
details.

best regards
Yuriy

On Wed, Jan 22, 2014 at 2:15 PM, JamesTryand notifications@github.comwrote:

This is from the binary release 2.0.1 running on windows7 64bit.
padmin used was from the source build (commit : 8ef23afhttps://github.com/EventStore/EventStore/commit/8ef23af341976d4f92580cdae28921bd0e325393)

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)


Reply to this email directly or view it on GitHubhttps://github.com/EventStore/EventStore/issues/86
.

Yuriy Solodkyy
(y.solodkyy@gmail.com)

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