Skip to content
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

PaxosStateBridge does not propagate SiriusResults from the RequestHandler #6

Open
comcast-jonm opened this issue Jan 29, 2014 · 2 comments

Comments

@comcast-jonm
Copy link
Member

Currently, when the PaxosStateBridge receives a Paxos decision, it acks the update back to the originating client with a SiriusResult.none() before that update has been persisted or applied to the brain via the RequestHandler. This means there is no way to tell if an exception was thrown while trying to apply it, and there is no way to have a return value from the RequestHandler's enqueuePut or enqueueDelete methods.

Possible solutions:

  • Delay the ack at least until the update has been run through the RequestHandler, and reply with the return value of handlePut/handleDelete
  • Change the RequestHandler interface so that enqueuePut/enqueueDelete return a Future<Unit>, to make it clear there is no information being propagated out
@smuir
Copy link
Contributor

smuir commented Feb 21, 2014

In the course of hacking up a prototype 'tagged' interface, I came up with a workaround for this problem. It is similar to the first suggestion Jon suggested, in that it passes back the handler function return value, but does so by adding a Promise to the request (in the same way as the tag object) and using the return value to complete the Promise. It works, and is easy to understand, but might be violating the actor model by short-circuiting a value directly rather than sending a message.

[On further thought I think this is a dumb idea, not only for the argument raised above but also because I'm not sure Akka wants you to pass 'complex' objects like Promise around]

@smuir
Copy link
Contributor

smuir commented Feb 24, 2014

A quick eyeball of the code suggests that implementing Jon's first suggestion might require nothing more than deleting the line where 'SiriusResult.none' is sent back by the PaxosStateHandler. Is there any reason not to just do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants